Installing libjpeg on OS X
From the This-gotta-get-easier-Department
Installing the Python Image Library on Mac OS X is still causing me some headaches, despite having found a working solution previously. My main gripe with that solution is, that it relies on Darwin Ports to install the necessary supporting libraries for PIL to handle jpeg, png and other formats.
These days I’m rather wary of tools such as fink or DarwinPorts – I don’t install that terribly much stuff in the first place, anyway and secondly, the out-of-the-box install experience for most tools has significantly improved over the past two years (mainly, I assume, because a lot of UNIX/Linux developers use Mac OS X themselves these days).
Well, exceptions prove a rule, as they say and libjepg does just that. Luckily, Matías Giovannini has shared how he managed to install libjepg (and other libs!) on Mac OS X in his account of installing GD40.
For libjpeg it boils down to this (after downloading and unpacking the sources):
% cd jpeg-6b/
% ln -s `which glibtool` ./libtool
% setenv MACOSX_DEPLOYMENT_TARGET 10.4
% ./configure --enable-shared && make && sudo make install
Then you can proceed to install PIL itself (the order is crucial, because if libjepg isn’t present at install time, PIL will be built without support for it.)
Also, if you’re experiencing trouble with getting resized images to show up, you should pay portal_atct/manage_imageScales in ZMI a visit and let it recreate the sizes.

corrections
For me it didn't work fully.
I had to do: export MACOSX_DEPLOYMENT_TARGET=10.4 instead of setenv and also a sudo for the install is necessary