change the image module from PIL to Pillow