     {
         var sourceImage: UIImage = self
         var newImage: UIImage? = nil
-        var newTargetSize: CGSize
+        var newTargetSize: CGSize = targetSize
         
         let imageSize: CGSize = sourceImage.size
         let width: CGFloat = imageSize.width

            }
        }
        
        UIGraphicsBeginImageContextWithOptions(targetSize, false, UIScreen.mainScreen().scale)
        var thumbnailRect: CGRect = CGRectZero
        thumbnailRect.origin = thumbnailPoint
        thumbnailRect.size.width  = scaledWidth


import Foundation
import UIKit
import CoreImage
import Accelerate

extension UIImage
{
