Fix hidden error when image is currently in use
What does this MR do?
When a CI pipeline tries to re-build an image that is currently in use, it is unable to delete the image, but the error is currently hidden by the code, so the job fails at a later unrelated stage.
Adds a check to see if the image exist, before attempting deletion, and stop hiding errors from the deletion.
Why was this MR needed?
Gets a better error message in https://gitlab.com/gitlab-org/ci-cd/shared-runners/images/macstadium/orka/-/jobs/1553514549#L412
What's the best way to test this MR?
I generated an error by creating a VM while the pipeline was running, so it is working properly: https://gitlab.com/gitlab-org/ci-cd/shared-runners/images/macstadium/orka/-/jobs/1555921264
What are the relevant issue numbers?
Edited by Adrien Kohlbecker