Img with transform.
.frame {
display: inline-block;
img {
max-width: 100%;
max-height: 100%;
position: absolute;
left: 50%;
top: 0;
transform: translate(-50%, -50%);
}
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<div class="frame">
<img src="http://lorempixel.com/1000/500/cats" alt="">
</div>
</body>
</html>