When you upload file, the error appears, but the file uploads.
I bet the file is invalid. You might check by viewing. We my continue the upload so user can look at or could be a mime issue.
Does it with jpg or png in the patient photograph folder. Same error, but upload the file.