apply: refactor `struct image` to use a `struct strbuf`