this is ugly :( - I'd rather you change the format->write() prototype so it accepts multiple mapcache_images, and remove the write_frames prototype