CMS-3965 Improve Image caching