add try statment for PIL.Image