fix resource_metadata failure missing image data

When image metadata is missing kernel and ramdisk causes exception.

Fixes bug 1197180

(cherry picked from commit 298e2f7e7b7074f1b6dab8175fa19bc456f4a0c4)
Change-Id: Iefb3ac8e92c273ddfff28fe848d2e7b0e6406321