diff --git a/renku/domain_model/dataset.py b/renku/domain_model/dataset.py
index 59dd3deae0..8d234241ff 100644
--- a/renku/domain_model/dataset.py
+++ b/renku/domain_model/dataset.py
@@ -180,7 +180,7 @@ class ImageObject(Slots):
 
     id: str
     content_url: str
-    position: str
+    position: int
 
     def __init__(self, *, content_url: str, id: str, position: int):
         id = get_path(id)
@@ -656,8 +656,9 @@ def update_metadata_from(self, other: "Dataset", exclude=None):
         # and not match the SHACL definition for Renku. This cannot be addressed in the dataset
         # providers because the dataset providers do not have access to the dataset ID which is needed
         # for setting the dataset image ID.
-        for image_ind in range(len(self.images)):
-            self.images[image_ind].id = ImageObject.generate_id(self.id, self.images[image_ind].position)
+        if isinstance(self.images, list):
+            for image_ind in range(len(self.images)):
+                self.images[image_ind].id = ImageObject.generate_id(self.id, self.images[image_ind].position)
 
     def update_metadata(self, **kwargs):
         """Updates metadata."""