The gallery is based on a sturdy 'Fallback-first' before switching to CSS grid at the first default breakpoint. The images have been positioned into a line-based grid system.
The challenge is really to find images in a size and shape that fit into the grid without losing their proportions. It needs a bit of practising. Start with a small grid and few images, from there you can expand. The maximum grid cells are 12 x 12, for this component 12 x 7 have been used. Clearly, each image covers more than just one cell.