Fixed for Python 3 compatibility

Fixed imports to make Cartesius compatible with Python 3 and Pillow.