.wpw-gallery {
    display: flex;
    flex-flow: column wrap;
    /* Your container needs a fixed height, and it 
     * needs to be taller than your tallest column. */
    height: 810px;
    counter-reset: items;
  }
  
  .item {
    width: calc(100% / 3);
    position: relative;
    box-sizing: border-box;
    padding: 4px;
  }
  
  /* Re-order items into 3 rows */
  .item:nth-of-type(3n+1) { order: 1; }
  .item:nth-of-type(3n+2) { order: 2; }
  .item:nth-of-type(3n+3) { order: 3; }
  .item:nth-of-type(3n)   { order: 4; }
  
  /* Force new columns */
  .break {
    flex-basis: 100%;
    width: 0;
    margin: 0;
    content: "";
    padding: 0;
  }