The object-fit: cover; value preserves the aspect ratio, and the image fills the container. The image will be clipped to fit: