Use a full class definition instead of a lambda to avoid issues with the definition being serialized by other apps like Sorl http://stackoverflow.com/questions/14266950/wrong-url-with-django-sorl-thumbnail-with-amazon-s3