Added file upload validation, and delete if invalid