added untested function to create PIL image from buffer