Added method to generate an image from the rootview controller.