Add conversion of dia source images for ebooks and pdfs

The conversion is done on the fly to generated best matched formats of
images for each transformation. The conversion requires obviously `dia` to
be installed. For PDF, additionally, `epstopdf` must be available.