refactor scaling, including a new option 'dpi'

Image resolution was rather low, so I introduced a `dpi` attribute. By now, it is only supported my `dot` and for scaling in PDF. The `scale` parameter can also be used, but it creates thumbnails instead of just modifying the image metadata. I also thought about adding a `size` attribute but this will be more complicated, because sizes can be specified as both pixel (for HTML) and mm (for PDF). Most convenient would be to use `size` in mm/cm together with `dpi`.