Added option to generate an image file instead of a PDF one.
Multi-page support