added support for returned PIL images