[core] fix a crash when an image is selected with no target device

* Closes #405