move PIL import
apply