QUOTE(hzqr @ Feb 26 2017, 12:18)

I believe the system tries to group galleries in rows based on the height of their cover pages, that's why you see some weird reordering
^ this is absolutely correct. The thumbnails are reorganised to optimise screen space.
(we never got the exact algorithm though. Probably it accumulates horizontal ones 'till it has enough to fill a row and display vertical only 'till then. There's likely threshold of how many vertical rows can be added whilst accumulating the horizontal row, since you get mixed rows from time to time (which are not the last row).)