image.mk: replace some template abstraction with make pattern rules