Attached a screenshot of gallery view after CSS changes.
4:3 both portrait and landscape will no longer be distorted at all and will be cropped.
16:9 both portrait and landscape will be distorted very slightly and will be cropped.
Extreme aspect ratios will be distorted and cropped.
Square aspect ratios will be cropped.
A greater max width and height allows for 16:9 images to display without distortion but crops too much of the image. A lesser max width and height introduces too much distortion on 16:9 images.
For this view, a slight distortion of 16:9 images and greater distortion of extreme aspect ratios after these changes is acceptable. The existing detailed view, forthcoming mosaic view, gallery variants, and other views will satisfy use cases where the original aspect ratio is required.