Fixes to make it work with Django 1.6.5 and Pillow instead of PIL