Адаптивное изображение по центру страницы

CSS:

.parent {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    white-space: nowrap;
    text-align: center;
    font-size: 0;
  }

  .parent:before {
    height: 100%;
    display: inline-block;
    vertical-align: middle;
    content: '';
  }

  .block {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 100%;
    display: inline-block;
    white-space: normal;
    vertical-align: middle;
    text-align: left;
    box-shadow: 0 0 40px rgba(0, 0, 0, .1) inset;
    background-color: #fff
  }

HTML:

<div class="parent"><img class="block" src="image.jpg" alt="" /></div>