On a computer without a webcam, if I try to get a patient image using the webcam button it understandably fails. However if I then try to upload a patient image, it just says "Please wait for photo upload dialog to be launched".
This is because in capturePhoto.js, the line dialogOpen = true; is set in the function launchPhotoCapturePopup even if the webcam fails to launch.
Perhaps that line should be moved to just above captureDialogElement.dialog('open'); (2 places)