Improve error logging

One of the details error loggers used the image id instead of an
error code.

Change-Id: I3c13abe883b535a938b3b3a28fbcb1ba8f77b01c