image: fix handling of per-device kernel build commands