Support both Pillow and PIL