added handling of NSData and contentMode