Minor tweaks to the templates and generators for "img"