svg external bitmap

This patch enables saving bitmaps in svg as external files, so as to reduce output size and rendering costs, and allow easier post-processing of bitmaps.

Currently only DCT images can be saved as jpg, other images are still embedded in svg.

I found this function a little bit weird, both the return value and an argument are used as output.
Actually I found `path` is not used in the places where this function is used, so what's the point?