Various patches and improvements

I think they should capture all, if not, there are bugs. Simply put a printf in those functions and test with some PDFs. 
By the way, If one image xobject is drawn many times on a PDF page, `drawImage()` will be called many times, while `setMimeData()` may be called only once. In the output SVG, there may be only one `<image>` element, while there are many `<use>` elements referencing that `<image>`. According to your tests, which element's count is more relevant to killing a web browser?