When pulling by image digest the identifiers that
were produced by parsing image digest were later
overwritten by code parsing image tag.
This resulted in invalid identifiers being used
when contacting the remote endpoint, resulting in 404.
Reported here:
http://lists.freedesktop.org/archives/systemd-devel/2015-June/033039.html
This makes working with complexly structured documents easy
and more reliable as the parser is not susceptible to
element re-ordering.
Also fixes a bug when the tokenizer would choke after reading
a number.