title: CGImage to UIImage doesn't work
body: <p>I'm developing and iOS app for iPad and I use Grabkit in order to get images from Facebook, Twitter, Flicker and also the Camera Roll. To get the images from the last one, I need to convert a CGImage to an UIImage, but I'm having trouble with that. Is like if I didn't get any image, because when I use the UIImage later, the app crashes with this log: </p>
  
  <pre><code> *** Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer position contains NaN: [nan 653]'
  </code></pre>
  
  <p>I'm using the following code to convert the CGImage: </p>
  
  <pre><code>UIImage* image = [UIImage imageWithCGImage:imgRef];
  </code></pre>
  
  <p>So this code doesn't crash, but when I use the image created, it does. What is happening? Is the code wrong?</p>