title: Neatly arrange different sized images into a grid
body: <p>I'm trying to arrange images into a neatly packed grid like in the screenshot. The images come from a CMS so they can be any size.</p>
  
  <p>How can I make this work either using CSS or JS?</p>
  
  <p><img src="https://i.stack.imgur.com/D0dCu.png" alt="enter image description here"></p>