Invalidate the cache on adding and deleting images.