diff --git a/ci-scripts/Jenkinsfile-GitLab-COTS-UE-Test b/ci-scripts/Jenkinsfile-GitLab-COTS-UE-Test
index baa9bc389207f5850d6c9a84b0bd41694b96bcd9..f5677e1d26b1fa8da0ae53e071396d02107683f7 100644
--- a/ci-scripts/Jenkinsfile-GitLab-COTS-UE-Test
+++ b/ci-scripts/Jenkinsfile-GitLab-COTS-UE-Test
@@ -69,7 +69,6 @@ boolean testStart0   = true
 boolean testStart1   = true
 boolean testStop0    = true
 boolean testStop1    = true
-boolean pulledImage  = false
 
 //-------------------------------------------------------------------------------
 // Pipeline start
@@ -269,7 +268,7 @@ pipeline {
             testStart1   = false
             testStop0    = false
             testStop1    = false
-            if (pulledImage) {
+            if (ranFullImage.contains('porcepix')) {
               sh "docker rmi ${ranFullImage} || true"
             }
           }
@@ -345,7 +344,7 @@ pipeline {
               sh "docker-compose down -t 3 || true"
             }
             deployedGNB = false
-            if (pulledImage) {
+            if (ranFullImage.contains('porcepix')) {
               sh "docker rmi ${ranFullImage} || true"
             }
           }
@@ -606,7 +605,6 @@ def checkAndPullRanImage (ranFullImage) {
     if (ranFullImage.contains('porcepix')) {
       sh 'docker logout porcepix.sboai.cs.eurecom.fr'
     }
-    pulledImage  = true
   }
 }