The image is wrapped in a container. The aspect ratio applies to the image's container, not the image itself. When the image and the container have different aspect ratios, the question becomes how to fit the image into the container.
There are three options available:
contain big images
See the examples below. The black outline is used to show the size of the container.