Optimizing and deleting photos