I am working with images, and I ran across a problem with aspect ratios.
Here is a solution :
img { width: 100%; height: auto; object-fit: cover; }
This will make sure the image always covers the entire parent (scaling down and up) and keeps the same aspect ratio.