<div class="img_wrap">
<img src="img.png"></img>
</div>
.img_wrap{
width:16rem;
height:9rem;
display : flex;
align-items : center;
justify-content: center;
img{
width : auto;
height : auto;
max-width : 100%;
max-height: 100%;
}
}