Change Image in component

I have a component that contains an image. When I change the image to one that has other dimensions (e.g. it’s higher), the original dimensions of the image are maintained and the new image is cropped. I would like the height of the image to adapt to the new image.
Any ideas?
Thank you!

(Any other way than using variants of a component for the image)