Really, all that you need to specify is a way to uniquely identify the set of containers that you want the task to operate on. This is either:
name, OR
image, plus optional command.
If you’re using a state that could create a new container, then the image is required so that Docker knows what image to use, but for state=stopped, state=killed or state=absent, we shouldn’t require image if you’ve already specified a name. In fact, I think it’s ignored in those cases, so you can pass it a garbage value and no behavior will change.