Image grid with clear order and different aspect ratio

I am making an image grid which shows about 200 images and they are user submitted, so I do not know the dimensions of the images. Some are portrait. Others are landscape. Most are landscape.

I have seen similar questions, but my requirements are different, so I cannot use their answers.

  • The order of the images must be clear to the user (so we cannot masonry grid)
  • We can inspect the photos and decide how to show them based on their size
  • We can cut some off the photos if needed, but we cannot show a portrait photo in landscape mode and vice versa.

These rules seems to inevitably end up with the following view:

enter image description here

However, I don't like it because of the grey boxes or worse yet, without the grey, it looks pretty chaotic. What is an alternative to this view, considering the same rules?

UPDATE: StackExchange user "locationunknown" suggested I look at Flickr. Because I cannot add an image to a comment, here is a screenshot from Flickr to illustrate what he means.

enter image description here