Improved so image or video set to 100% works

Improved the way the image height and width are set, and the wrapper
height is set. Can now handle height of image set to 100%