Multipage PDFs, better temp files

A few changes here:
* Temporary files are now in their own directory, instead of the system temp dir
* Temporary files are deleted on exit
* Multipage PDFs are supported thanks to ImageMagick

Note: This commit introduces dependency on ImageMagick