*: use types.Hash to refer to images

This makes the interface to stage0 a bit more robust.
aside: the Val field is sort of a weird name.