Refactor and delete uploaded images