Edit in JSFiddle

<div style="display:flex;flex-wrap:wrap;justify-content: center;">
  <div style="height:300px;width:300px;
              background-image:url(https://lorempixel.com/400/300/animals/1/est);
              background-repeat: no-repeat;
              background-size: cover;
              background-position: center;
              ">
  </div>
  <img src="https://lorempixel.com/400/300/animals/1/est" alt="">
</div>