corrects exporting of images and pdf

Solves #199.