For those on Mac OS Mountain Lion, I followed the anwser of zeantsoi, but it doesn't work.
I finally ended up with the solution of this post: http://appelfreelance.com/2010/06/libjpeg-pil-snow-leopard-python2-6-_jpeg_resync_to_restart/
Now, I'm happily running my script for jpeg !