private static void HandleJPEGFileAdded(object source, FileSystemEventArgs e)
        {
            MainWindow.LogMessage("New JPEG file added at " + e.FullPath);

            //It takes a bit after creation before the file is sendable, sleep a few seconds
            XMLFileWatcher.EnableRaisingEvents = false;
            Thread.Sleep(5000);
            XMLFileWatcher.EnableRaisingEvents = true;
            try
            {
                MainWindow.LogMessage("Uploading JPEG image");
                string results = WebManager.uploadWebcamImage(e.FullPath);
                MainWindow.LogMessage(results);
            }
            catch (Exception ex)
            {
                MainWindow.LogError("Unable to upload JPEG image", ex);
            }

            try
            {
                File.Delete(e.FullPath);
            }
            catch (Exception ex)
            {
                MainWindow.LogError("Unable to delete the file after upload", ex);
            }
        }