Before someone asks me why the hell I would want to do this let me come straight out and tell you. That way one of you clever peeps out there can tell me a far better way...
To go off of Samec's answer, you can also use this to center an absolute position element vertically and horizontally of unknown dimensions:
#viewer_div { position: relative; } #viewer_div img { position: absolute; left: 50%; top: 0%; transform: translate(-50%, 50%); }