My docker swarm creates a <none> images on which is keeps running when trying to update

I just began using docker-swarm with docker-compose and I have run into a problem: when I try updating a service it creates a new image which basically is the old one except it has the name <none> and the tag <none> and the service keeps running on that image

I have tried rebuilding everything from scratch which did not work and I can remove the <none> image because it says it is used in a container and cannot be forced removed either

So my question is how do I use the new build image in the container instead of the <none>?

Source: StackOverflow