Check if docker image exists before reinstalling