<div id="justified" class="justified-gallery">
  <a href="#">
        <img src="https://unsplash.it/400/300/?image=514" alt="" width="600" height="300">
    </a>
  <a href="#">
        <img src="https://unsplash.it/400/300/?image=512" alt="" width="400" height="300">
    </a>
  <a href="#">
        <img src="https://unsplash.it/400/300/?image=511" alt="" width="800" height="400">
    </a>
  <a href="#">
        <img src="https://unsplash.it/400/300/?image=516" alt="" width="1600" height="500">
    </a>
  <a href="#">
        <img src="https://unsplash.it/400/300/?image=510" alt="" width="300" height="550">
    </a>
</div>
/* this line is default img class on Foundation *//* this line is default img class on Foundation */
/*
img {
    max-width: 100%;
    height: auto;
}
*/
$("#justified").justifiedGallery({waitThumbnailsLoad: false});

External CSS

  1. https://cdnjs.cloudflare.com/ajax/libs/justifiedGallery/3.6.5/css/justifiedGallery.min.css

External JavaScript

  1. https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js
  2. https://cdnjs.cloudflare.com/ajax/libs/justifiedGallery/3.6.5/js/jquery.justifiedGallery.js