added cache to the renderer class
now we render the document first then we can acess the rendered images with our cache, which makes the access much faster