Implementation of images caching.