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;
}
.s-inner {
  position: relative;
  display: -webkit-flex;
  display: flex;
  max-height: 100%;
  max-width: 100%;
  box-sizing: inherit;
  margin: auto;
}
.s-inner > figure {
  display: block;
  margin: 0 auto 0 auto;
  box-sizing: border-box;
}
.s-inner > figure > img {
  box-sizing: border-box;
  max-width: 100%;
  max-height: 100%;
  height: 200px; // add height of the .wrap
}