When your images vary in size or orientation, there are only a few reliable ways to display them on a page without leaving any white space. Below are three layout options that keep everything aligned—whether that means matching the tops, the bottoms, or fully filling the available space.
These options will work smoothly no matter what size or orientation your images are when you upload them.
Lastly, using 4 columns and even number of images also ensures success. Less guess work than with 3 columns and odd numbers