extract image logic
remove existing containers before running a new container