Help creating a component for a segment with text and a background image that needs to scale


I have some issues creating a component for a segment for a web where there is text on the left 50% and an image on the right 50%. I would like to make a component where the image is an object so I can switch between images. But the real issue here is that how much I try I won’t get the image to resize according to it’s aspect ratio.

No matter if I use the image as a mask or in auto layout I won’t get it to keep it’s aspect ratio when the segment component gets taller because of text added.

Preferably I would like to be able to resize the image as a component, so that I can slap on the component in the design, change the image, enter the text and then fine tune the positioning of the image.

Is there any solution to this? Any ideas?

Screenshot of the component:

Did you try all the image possible positions ? Look like setting the background as fill or fit would solve your problem