title: UIGraphicsBeginImageContextWithOptions crashes silently without error
body: <p>SO I have a function which takes 2 images and combines them. Maybe the images are too large because when I try it with 2 smaller images it works fine but I am not sure. So I take a photo on my camera and try and open it from the album. I pick the Image and combine it with another image using this function:</p>
  
  <pre><code>- (UIImage*)imageByCombiningImage:(UIImage*)firstImage withImage:(UIImage*)secondImage {
  
      UIImage *image = nil;
  
      float scale = 0.5f;
  
      CGSize newImageSize = CGSizeMake(MAX(firstImage.size.width, secondImage.size.width), MAX(firstImage.size.height, secondImage.size.height));
  
          NSLog(@"reached image by combining image");
      //crashes here when the image has been selected from an album (secondImage).
      // runs fine when the image has been taken from the camera. (secondImage). 
  
      if (UIGraphicsBeginImageContextWithOptions != NULL) {
          UIGraphicsBeginImageContextWithOptions(newImageSize, NO, [[UIScreen mainScreen] scale]);
      } else {
          UIGraphicsBeginImageContext(newImageSize); 
      }
  
  
  
      [firstImage drawAtPoint:CGPointMake(roundf((newImageSize.width-firstImage.size.width)/2), 
                                          roundf((newImageSize.height-firstImage.size.height)/2))]; 
  
      UIImage *scaledImage = 
      [UIImage imageWithCGImage:[secondImage CGImage] 
                          scale:scale orientation:UIImageOrientationUp];
  
      [scaledImage drawAtPoint:CGPointMake(roundf((100)), 
                                           roundf((100)))]; 
      image = UIGraphicsGetImageFromCurrentImageContext();
      UIGraphicsEndImageContext();
  
      return image;
  }
  </code></pre>
  
  <p>When I get to this line: </p>
  
  <pre><code>if (UIGraphicsBeginImageContextWithOptions != NULL) {
      UIGraphicsBeginImageContextWithOptions(newImageSize, NO, [[UIScreen mainScreen] scale]);
  } else {
      UIGraphicsBeginImageContext(newImageSize); 
  }
  </code></pre>
  
  <p>it crashes silently. I think it might be a memory problem? 
  The method is also being called asynchronously. </p>