title: Algorithm for laying out images of different sizes in a grid-like way
body: <p>I'm trying to lay out images in a grid, with a few featured ones being 4x as big.
  I'm sure it's a well known layout algorithm, but i don't know what it is called.</p>
  
  <p>The effect I'm looking for is similar to the screenshot shown below. Can anyone point me in the right direction?</p>
  
  <p><strong>UPDATED</strong>
  To be more specific, lets limit it to the case of there being only the two sizes shown in the example. There can be an infinite number of items, with a set margin between them. Hope that clarifies things.</p>
  
  <p><img src="https://i.stack.imgur.com/Nw0f4.jpg" alt="enter image description here"></p>