Tweaked example code to not create temp variable for UIImage