Implement re-caching of image references in the database