Change: Do not compare the PIL Image class with None as this triggers an
exception