Adding optional validation to file uploads