+ (UIImage*) thumbnaiWithImage:(UIImage*)image size:(CGSize) size { UIImage *newImage = nil; if (image != nil) { UIGraphicsBeginImageContext(size); [image drawInRect:CGRectMake(0, 0, size.width, size.height)]; newImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); } return newImage; }