     /**
     Check if the image is in grayscale
     
-    :returns: Returns YES if is in grayscale, NO if not
+    :returns: Returns true if is in grayscale, false if not
     */
     public func isGrayscale() -> Bool
     {

        let width: CGFloat = imageSize.width
        let height: CGFloat = imageSize.height
        
        if UIDevice.isRetinaHD()
        {
            let retinaTargetSize: CGSize = CGSizeMake(targetSize.width * 3, targetSize.height * 3)
            if !CGSizeEqualToSize(imageSize, retinaTargetSize)
            {
                newTargetSize = retinaTargetSize
            }
        }
        else if UIDevice.isRetina()
        {
            let retinaTargetSize: CGSize = CGSizeMake(targetSize.width * 2, targetSize.height * 2)
            if !CGSizeEqualToSize(imageSize, retinaTargetSize)
            {
                newTargetSize = retinaTargetSize
            }
        }
        
        let targetWidth: CGFloat = newTargetSize.width
        let targetHeight: CGFloat = newTargetSize.height
        

    public func imageByScalingProportionallyToMaximumSize(targetSize: CGSize) -> UIImage
    {
        var newTargetSize: CGSize = targetSize
        
        if (self.size.width > newTargetSize.width || newTargetSize.width == newTargetSize.height) && self.size.width > self.size.height
        {
