I am trying create something like this.

As you can see in this image there are 3 columns which are same width. Its has rows which are different height. I have tried this so far code pen
    <div class="wrapper">
  <div><img src="https://source.unsplash.com/random/1200x600" alt=""></div>
  <div><img src="https://source.unsplash.com/random/400x800" alt=""></div>
  <div><img src="https://source.unsplash.com/random/500x1000" alt=""></div>
  <div><img src="https://source.unsplash.com/random/1600x1000" alt=""></div>
  <div><img src="https://source.unsplash.com/random/1600x1000" alt=""></div>
  <div><img src="https://source.unsplash.com/random/800x1000" alt=""></div>
  <div><img src="https://source.unsplash.com/random/1000x900" alt=""></div>
  <div><img src="https://source.unsplash.com/random/600x1200" alt=""></div>
  <div><img src="https://source.unsplash.com/random/1200x400" alt=""></div>
  <div><img src="https://source.unsplash.com/random/600x1200" alt=""></div>
  <div><img src="https://source.unsplash.com/random/1100x200" alt=""></div>
  <div><img src="https://source.unsplash.com/random/1600x1200" alt=""></div>
  <div><img src="https://source.unsplash.com/random/1200x300" alt=""></div>
  <div><img src="https://source.unsplash.com/random/1200x1200" alt=""></div>
  <div><img src="https://source.unsplash.com/random/1000x1200" alt=""></div>
</div>
Css:
    .wrapper {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: auto;
  grid-gap: 10px;
}
.wrapper div {
  border: 2px solid whitesmoke;
  background: #ccc;
}
.wrapper div img {
  width: 100%;
}
I will be getting different different images of different sizes on every refresh. so i need to make a row of the content height. How can i achieve this using Css Grid? Thank you.
 
     
    