How to upload a content image and allow an enlarged view when clicked?

Hi all,

My use case is that I am creating content (all types) using the REST API.

My issue is that when I create content manually that has an image, the image can be clicked for a pop-up enlarged view of the image.  But when I create content via REST this does not occur.

What I am finding is that the URL patterns are different for manually created vs. programmatically created content.  When I upload the image via REST I upload it to CFS and then use the [View:] macro code in the content body.

This URL is created by uploading an image and placing it some content:

/cfs-file/__key/communityserver-wikis-components-files/00-00-00-00-48/2055.image3698.png

And this URL is created by creating content manually and dropping an image into the content:

/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/Screen-Shot-2020_2D00_12_2D00_18-at-4.58.22-PM.png

My expectation is that the /resized-image/ path is what triggers the addition of the JS code for the enlarged image pop-up.

Question: How can I translate the non-popup URL to a pop-up URL?  Or do I need to upload the image using a different REST endpoint?

Thanks.