Problem solved. It happened because of a feature I didn’t have an idea existed. You can pinch to get smaller thumbs and thus more per row and “spread out” to get larger and fewer per row. Must have done the latter by accident.

Now I wonder what that setting I found is for. Because it still doesn’t seem to do anything.