import Image and ImageEnhance from PIL for pillow compatibility