Add imageFromView method to UIImage.