         CGContextDrawImage(bitmapContext, imageRect, image.CGImage)
 
         if let newCGImage = CGBitmapContextCreateImage(bitmapContext) {
-            return UIImage(CGImage: newCGImage, scale: screenScale, orientation: imageOrientation)
+            let image = UIImage(CGImage: newCGImage, scale: screenScale, orientation: imageOrientation)
+            return image
         }
 
         return nil

        CGContextDrawImage(bitmapContext, drawTransposed ? transposedRect : newRect, CGImage)

        if let newCGImage = CGBitmapContextCreateImage(bitmapContext) {
            return UIImage(CGImage: newCGImage, scale: screenScale, orientation: imageOrientation)
        }

        return nil


        let bounds = CGRect(x: originalX, y: originalY, width: pixelSize.width / ratio, height: pixelSize.height / ratio)

        let image = cropWithBounds(bounds)?.resizeToSize(size, withInterpolationQuality: .Default)
        return image
    }
}

