Deleting all cached images when rebuilding the database