Cleaning up image scale calculations and image zooming behaviour.