Run the following commands and try again:
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
docker stop $(docker images -a -q)
docker rmi $(docker images -a -q)
If it still doesnt work then remove dangling containers and try again
docker rmi $(docker images -q --filter "dangling=true")