Made it so that the cache is not created if picture not uploaded. 
Added method in Header to delete the cache from the DB.