If you receive an error message similar to this:
Persits.Jpeg.1 error '80040035'
Not a JPEG file: starts with e.g. 0x38 0x42
you should ensure the file you are uploading has a proper file extension, like .jpg, .gif or .bmp depending on its actual file format/type.
If your file does not have a proper file extension (and is not in JPEG format (the default)) it will cause this error.