I am using bootstrap to make rows of images. On phone screens, there should be 2 images per row. On every screen size larger than phones, there should be 3 images per row. The code below works for screens larger than a phone, but on a phone it leaves a blank space after the 3rd image. How do I make it so on mobile there are no missing spaces?
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css" integrity="sha384-xOolHFLEh07PJGoPkLv1IbcEPTNtaed2xpHsD9ESMhqIYd0nLMwNLD69Npy4HI+N" crossorigin="anonymous">
<div class="row no-gutters">
<div class="col-6 col-sm-4">
<img src="https://via.placeholder.com/600" style="max-width: 100%;">
</div>
<div class="col-6 col-sm-4">
<img src="https://via.placeholder.com/600" style="max-width: 100%;">
</div>
<div class="col-6 col-sm-4">
<img src="https://via.placeholder.com/600" style="max-width: 100%;">
</div>
</div>
<div class="row no-gutters">
<div class="col-6 col-sm-4">
<img src="https://via.placeholder.com/600" style="max-width: 100%;">
</div>
<div class="col-6 col-sm-4">
<img src="https://via.placeholder.com/600" style="max-width: 100%;">
</div>
<div class="col-6 col-sm-4">
<img src="https://via.placeholder.com/600" style="max-width: 100%;">
</div>
</div>