catch internal server errors when uploading invalid files