Add ability to cache images in memory