Edit in JSFiddle

<div class="masonry-container">
   <img class="masonry-brick" src="https://i2.wp.com/www.innerheights.co.za/wp-content/uploads/2018/01/fullmoon-1.jpg"/>
   <img class="masonry-brick" src="http://images5.fanpop.com/image/photos/31700000/Beautiful-gifs-emmashields-31716647-450-313.jpg"/>
   <img class="masonry-brick" src="https://i2.wp.com/www.innerheights.co.za/wp-content/uploads/2018/01/fullmoon-1.jpg"/>
   <img class="masonry-brick" src="http://images5.fanpop.com/image/photos/31700000/Beautiful-gifs-emmashields-31716647-450-313.jpg"/>
   <img class="masonry-brick" src="http://images5.fanpop.com/image/photos/31700000/Beautiful-gifs-emmashields-31716647-450-313.jpg"/>
   <img class="masonry-brick" src="http://images5.fanpop.com/image/photos/31700000/Beautiful-gifs-emmashields-31716647-450-313.jpg"/>
   <img class="masonry-brick" src="http://images5.fanpop.com/image/photos/31700000/Beautiful-gifs-emmashields-31716647-450-313.jpg"/>
   <img class="masonry-brick" src="https://i2.wp.com/www.innerheights.co.za/wp-content/uploads/2018/01/fullmoon-1.jpg"/>
</div>
.masonry-container {
    -moz-column-count: 2;
    -webkit-column-count: 2;
    column-count: 2;
    column-gap: 2px;
    background-color: yellow;
    width: 100%;
    max-width: 768px;
    margin: 0 auto;
 }
.masonry-brick {
    padding: 0;
    margin-bottom: -2px;
    display: inline-block;
    width: 100%;
}