Aligning images on two rows with flexbox
<p>I am trying to create a flexbox with 6 boxes that go across the page.</p>

<p>However, for some reason it won't behave properly as they have different sizes.</p>

<p><a href="https://i.stack.imgur.com/SyrOL.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SyrOL.jpg" alt="enter image description here"></a></p>

<p>they must behave like this:</p>

<p><a href="https://i.stack.imgur.com/RDTvr.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RDTvr.jpg" alt="enter image description here"></a></p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-css lang-css prettyprint-override"><code>/* ================================= 
      Base Styles
    ==================================== */

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.row {
  flex: 1;
}
/* ================================= 
      Media Queries
    ==================================== */

@media (min-width: 769px) {
  .main-header,
  .main-nav,
  .row {
    display: flex;
  }
  .main-header {
    flex-direction: column;
    align-items: center;
  }
  .col {
    flex: 1 50%;
  }
  .row {
    flex-wrap: wrap;
  }
  .item-2 {
    order: -1;
  }
}
@media (min-width: 1025px) {
  .main-header {
    flex-direction: row;
    justify-content: space-between;
  }
  .col {
    flex-basis: 0;
  }
  .item-1 {
    flex-grow: 1.4;
  }
}</code></pre>
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="row"&gt;

  &lt;div class="item-1 col"&gt;
    &lt;img src="http://blackrockdigital.github.io/startbootstrap-freelancer/img/portfolio/cabin.png"&gt;
  &lt;/div&gt;&lt;!--/.primary--&gt;

  &lt;div class="item-2 col"&gt;
    &lt;img src="http://blackrockdigital.github.io/startbootstrap-freelancer/img/portfolio/cabin.png"&gt;
  &lt;/div&gt;&lt;!--/.secondary--&gt;

  &lt;div class="item-3 col"&gt;
    &lt;img src="http://blackrockdigital.github.io/startbootstrap-freelancer/img/portfolio/cabin.png"&gt;
  &lt;/div&gt;&lt;!--/.tertiary--&gt;

  &lt;div class="item-4 col"&gt;
    &lt;img src="http://blackrockdigital.github.io/startbootstrap-freelancer/img/portfolio/cabin.png"&gt;
  &lt;/div&gt;&lt;!--/.tertiary--&gt;

  &lt;div class="item-5 col"&gt;
    &lt;img src="http://blackrockdigital.github.io/startbootstrap-freelancer/img/portfolio/cabin.png"&gt;
  &lt;/div&gt;&lt;!--/.tertiary--&gt;

  &lt;div class="item-6 col"&gt;
    &lt;img src="http://blackrockdigital.github.io/startbootstrap-freelancer/img/portfolio/cabin.png"&gt;
  &lt;/div&gt;&lt;!--/.tertiary--&gt;

&lt;/div&gt;</code></pre>
</div>
</div>
</p>

<p>YOU CAN VIEW THE JSFIDDLE HERE: <a href="https://jsfiddle.net/ju157mnj/2/" rel="nofollow noreferrer">https://jsfiddle.net/ju157mnj/2/</a></p>