Updated to render first to off-screen buffer. This will allow for larger output images.