Place sorl_backends.py
on your path, and add the following to your django settings.
THUMBNAIL_BACKEND = 'sorl_backends.AutoFormatBackend'
# this is still used if the format cannot be automatically inferred (eg for a .gif image)
THUMBNAIL_FORMAT = 'JPEG'