<section class="gellery">
<h2 class="mb-5 font-weight-bold text-center">Gellery</h2>
<div class="col-md-6 mb-4">
<div id="carousel-example-1z" class="carousel slide carousel-fade data-ride="carousel>
<ol class="carousel-indicators">
<li data-target="#carousel-example-1z" data-slide-to="0" class="active"></li>
<li data-target="#carousel-example-1z" data-slide-to="1" class=""></li>
<li data-target="#carousel-example-1z" data-slide-to="2" class=""></li>
</ol>
<div class="carousel-inner z-depth-1-half" role="listbox">
<div class="carousel-item active">
<img class="d-block w-100 " src="/img/slide1.jpg" alt="First slide">
</div>
<div class="carousel-item">
<img class="d-block w-100 " src="/img/slide2.jpg" alt="First slide">
</div>
<div class="carousel-item">
<img class="d-block w-100 " src="/img/slide3.jpg" alt="First slide">
</div>
</div>
<a href="#carousel-example-1z" class="carousel-control-prev" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
</a>
<a href="#carousel-example-1z" class="carousel-control-next" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
</a>
</div>
</div>
</section>
.carousel-item {
height: 300px; /* Высота слайда */
position: relative;
overflow: hidden;
}
/*Можно добавить свой класс к изображению и заменить "img.d-block" ниже */
.carousel-item > img.d-block{
width: 100%;
height: 100%;
-o-object-fit: cover;
object-fit: cover;
top: 0;
bottom: 0;
right: 0;
left: 0;
margin: auto;
position: absolute;
}