Swig 3 0 fix

support both PIL and Pillow.