Fixed bug so images are cached as soon as they are converted to base64.