Fix auto-height issues for pages

Changed to calculate height based on real page width and image ratio