Here is the complete, copy-pasteable code. This uses the JavaScript approach because it's the only way to achieve your "combined scale" logic without manually typing in the dimensions of every single image. The script treats the images as one big unit, finds their natural aspect ratios, and scales them to fit the 500px width perfectly while keeping them all the same height. HTML
1 2 3