Just a minor change for supporting passing the PIL Image object directly