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.

gfree is poppler's convention:
```
/*
 * Same as free, but checks for and ignores NULL pointers.
 */
extern void gfree(void *p);
```
Yes, I think free() already ignores NULL, so they are the same.