Snug Gallery / Guides

Shopify masonry gallery: what order do the photos go in?

A masonry gallery keeps every photo uncropped, but the order can surprise you. See how Snug Gallery places each image and how to keep a sequence readable.

You upload twelve photos in a careful order, pick a masonry layout, and the page shows them in an order you did not choose: the fifth photo sits above the fourth, and the last one is halfway up the right-hand side. Nothing is broken. A masonry wall has to decide where each image goes, and there are two common ways to decide it, which give different reading orders. This guide explains the one Snug Gallery uses in its Masonry layout, what that means for a set of photos that tells a story, and which settings change the result. For a comparison with the other eight layouts, see the overview of gallery layouts.

Two ways to build a masonry wall

The older way uses text columns, the same feature a newspaper page uses. The browser pours the images down the first column until it is full, then starts the second, then the third. It is simple and needs no script, but the reading order runs down each column. With twelve photos in three columns, numbers 1 to 4 are the left column, 5 to 8 the middle and 9 to 12 the right. Your second photo is below the first, not next to it, and whoever looks at the top of the page sees photos 1, 5 and 9.

The other way places images across the page. The first photos fill the top of each column from left to right, and each one after that goes wherever there is room highest up. Snug's Masonry layout works this way. The top of the page shows photos 1, 2 and 3, which is what most people expect when they arrange a gallery.

Neither is wrong. They suit different content, and it helps to know which one you have before you spend an evening dragging thumbnails around.

How Snug places each photo

Every image in a Masonry gallery is as wide as one column and as tall as its own proportions make it. A portrait photo is a tall tile, a panorama is a short one. Nothing is cropped, and the Image shape setting on the block is ignored for this layout.

Placement follows one rule. Photos are taken in gallery order, and each goes to the highest free spot on the page; if two columns are level, the left one wins. In practice that means the next photo lands under whichever column is shortest so far.

Take three columns and six photos: a landscape, a tall portrait, a landscape, then three more. Photos 1, 2 and 3 go across the top. Photo 4 does not automatically go under photo 1. It goes under the shortest column, which is column 1 or column 3, since both hold a landscape and column 2 holds the tall portrait. Level columns go to the left, so photo 4 is in column 1. Photo 5 now sees column 3 as the shortest and lands there. Photo 6 goes wherever is highest after that, and column 2, with its tall portrait, may still be the longest and get nothing for another round.

The result is a wall with even bottoms. Columns stay close to the same length because every new photo tops up the shortest one. With the newspaper method, one column full of portraits can end far below its neighbours.

What that does to a sequence

Reading across the top row always works: the first photos are first. Further down, order is approximate. A photo can sit slightly higher on the page than the one before it, because it went to a shorter column. For a wall of customer photos, a studio portfolio or event pictures, nobody notices, and the even packing is worth more than strict order.

It matters when the photos are steps. A recipe, a build in progress, a before and after pair: if photo 7 must be read after photo 6, a masonry wall is the wrong tool. Use the List layout for steps with text, or Grid, where every tile is the same size and order runs strictly left to right, row by row.

There is a middle path. Order holds exactly when all photos have the same proportions, because then every column grows at the same rate and the shortest column is always the next one along. If your set is mostly 4:5 portraits with two landscapes in it, the two landscapes are what shuffle the order. Crop them to match before uploading, or move them to the end.

Settings that change the picture

Columns are set on the block in the theme editor, separately for each screen size: Columns on desktop from 1 to 6 (3 by default), Columns on tablet from 1 to 4 (2 by default) and Columns on mobile, 1 or 2. Because placement depends on column heights, the same gallery has a different arrangement at each width. Photo 5 may be in the third column on a laptop and the first on a tablet. Check all three before you publish.

On a phone with one column there is nothing to decide: the photos stack in exact gallery order. With two columns on mobile the rule applies again, with small tiles. Two is a good choice for a long wall of customer photos, and one is better when people should see each picture properly.

Spacing between images runs from 0 to 40 pixels, 12 by default. At 0 the wall is a solid mosaic, which suits photography with strong colour. The same value is used between columns and between rows.

Captions set to Below image add height to a tile. Snug measures the caption text and gives that tile the extra room, so a photo with a three-line caption counts as taller when the next photo looks for the shortest column. Long captions on some photos and none on others will move things around. The captions guide covers the overlay modes, which do not change tile height.

The layout recalculates when the browser window is resized and once the page's fonts have loaded, so the wall settles into its final shape a moment after it appears. The space for each image is reserved from the start from its known proportions, which keeps the page from jumping as photos load.

Sort order and new uploads

The gallery's sort order feeds the rule above. Manual keeps your dragged order. Newest first puts each new upload in the top left and moves everything else along, and since the proportions of the newcomer differ from the photo it replaced, the whole wall rearranges. That is fine for a feed of customer photos and annoying for a curated page. The guide to sort orders describes all four.

Masonry is forgiving about counts. There are no awkward numbers of images as there are in Collage, where the pattern wants multiples of three. Any count works, and the last row is ragged by nature. If one column ends much shorter than the others, move a tall portrait to the last position: it will go to the shortest column and level the bottom edge.

The tag filter bar works with Masonry too. When a visitor picks a tag, the photos that remain are placed again by the same rule, so a filtered view is a tidy wall of its own, not the old wall with holes in it.

Arrange a masonry gallery in ten minutes

  1. In the Snug Gallery app, open the gallery, choose Masonry as the layout and set the order to Manual.
  2. Put the three or four photos that matter most first. They are the top row on desktop and nothing will move them.
  3. Alternate tall and wide photos through the rest of the list so no column runs ahead of the others.
  4. In the theme editor, select the gallery block and set Columns on desktop, tablet and mobile.
  5. Preview at each width. If one photo sits in a bad spot, swap it with a neighbour of similar shape and look again.
  6. Put a tall photo last if the bottom edge is uneven.

When to pick something else

Choose Grid when order must be exact or when the photos should line up with product cards elsewhere on the page. Choose Row for a single strip of five or six photos at one height. Choose Collage when a few hero images should be larger than the rest. Masonry is the layout for photos you do not control: mixed phone pictures, a decade of project shots, anything where cropping would cut off the subject and where the wall as a whole matters more than the path through it.

Frequently asked questions

Does a Snug Gallery masonry layout read left to right or top to bottom?

Left to right. The first photos fill the top of each column from the left, and each later photo goes to the highest free spot, which is under the shortest column. The top row is always in gallery order. Further down, a photo can sit a little higher than the one before it when the columns have different heights.

Why are my masonry photos not in the order I set?

Because the photos have different proportions. Each new image goes under the shortest column, so after a tall portrait the next photos skip that column until the others catch up. Photos of identical proportions keep exact order. If strict order matters, use the Grid or List layout.

Does Masonry crop my images?

No. Every image keeps its original proportions at the width of one column, and the Image shape setting is ignored for this layout. Visitors see the full photo in the wall and again in the lightbox.

Why does the arrangement differ on desktop and tablet?

The number of columns differs, and placement depends on column heights. With three columns on desktop and two on tablet, the same list of photos fills different columns. On a phone with one column the photos are stacked in exact gallery order.

More guides