core/image: implement save() for PIL