Created an image cache, much faster at writing images now