Use qemu-img instead of file to detect type.

Change-Id: I4a88009dd81182820ec6fa58fec8db376c6e0edc