Cache image data when it is downloaded.