Pageheight calculation improvement

Fix for content that gets generated