Fix the case where a docker image is not part of a namespace.

Fixes #9016