add hashing and clean up code to handle basic deleting of images