JSFiddle - React, Tailwind, and code Playground

HTML

<div class="wrap">
     <div class="s-inner">
      <figure>
       <img src="http://www.trbimg.com/img-4fad2af0/turbine/hc-american-school-for-the-deaf-20120510-006">
      </figure>
     </div>
    </div>

CSS

.wrap{
  max-width:500px;
  max-height:200px;
  background:red;
  overflow: hidden;
}
.s-inner{
    position: relative;
    display: -webkit-flex;
    display: flex;
    height: auto;
    width: 100%;
    box-sizing:inherit;
    margin:auto;
  }
/*            Inside             */
    .s-inner > figure{
      display: block;
      margin: 0 auto 0 auto;
      box-sizing: border-box;
    }
      .s-inner > figure > img{
        box-sizing: border-box;
        width: 100%;
        height: auto;
    }