Fix bug when deleting attachments that don't have an uploaded file or that have been reset.