fix a <no-device> bug caused by dimg.c