Written an image using NSData