cleanup output of PNG and PDF