Moved caching to gd renderer, tidy up