Updating ImageSensor to use pillow instead of PIL.