fix memory error when using Page::renderImage()