Modified version of the cached image library.