Fix Docker image name parsing

Fixes #8357