When using Bootstrap 5, the col-sm-6 and col-sm-4 classes do not function correctly on small and medium screens, but work fine on large screens. The goal is to display 2 images on small screens and 3 images on medium screens. However, only 4 images are displayed properly on large screens, causing an issue on smaller screens. I am new to Bootstrap and would appreciate any help in resolving this problem.
For visual reference, please see the attached images: https://i.sstatic.net/A0HMF.png.
https://i.sstatic.net/eNnR9.png
https://i.sstatic.net/l7eT4.png
<div class="container">
<div class="row">
<div class="col-md-12">
<div id="carouselExampleIndicators" class="carousel slide" data-bs-ride="carousel">
<div class="carousel-indicators">
<button type="button" data-bs-target="#carouselExampleIndicators" data-bs-slide-to="0" class="active" aria-current="true" aria-label="Slide 1"></button>
<button type="button" data-bs-target="#carouselExampleIndicators" data-bs-slide-to="1" aria-label="Slide 2"></button>
<button type="button" data-bs-target="#carouselExampleIndicators" data-bs-slide-to="2" aria-label="Slide 3"></button>
</div>
<div class="carousel-inner">
[content removed for brevity]
</div>
</div>
</div>
</div>
</div>