Create Thumbnail from UIImage
To create a thumbnail of a image, we are going to draw a scaled-down version of the full image to an offscreen context and keep a pointer to that new image inside a object instance. You also need a place to store this thumbnail image so that it can be reloaded when the application launches again.