This question already has an answer here:
If I have a grid of images, let's say political cartoons, that have differing aspect ratios and cannot be cropped, how can I display them in a grid or even linear fashion?
This is for a newspaper website, I have hundreds of political cartoons that cannot be cropped to a consistent aspect ratio due to content. I can display them linearly, top to bottom, but I would rather have a grid of some sort.
New cartoons will be added regularly, so the whole thing needs to be flexible.