Fix splitting the tag from the image name

Fixes #8983