Index: kernel/classes/datatypes/ezimage/ezimagealiashandler.php
===================================================================
--- kernel/classes/datatypes/ezimage/ezimagealiashandler.php	(revision 24714)
+++ kernel/classes/datatypes/ezimage/ezimagealiashandler.php	(working copy)
@@ -738,7 +738,7 @@
 
                 // Fetch ezimage attributes that use $filepath
                 // Always returns current attribute (array of $contentObjectAttributeID and $contentObjectAttributeVersion)
-                $dbResult = eZImageFile::fetchImageAttributesByFilepath( $filepath, $contentObjectAttributeID );
+                $dbResult = eZImageFile::fetchImageAttributesByFilepath( $filepath, $contentObjectAttribute->attribute( 'contentclassattribute_id' ) );
                 $dbResultCount = count( $dbResult );
                 // Check if there are the attributes.
                 if ( $dbResultCount > 0 )
Index: kernel/classes/datatypes/ezimage/ezimagefile.php
===================================================================
--- kernel/classes/datatypes/ezimage/ezimagefile.php	(revision 24714)
+++ kernel/classes/datatypes/ezimage/ezimagefile.php	(working copy)
@@ -95,24 +95,24 @@
 
     /**
      * Looks up ezcontentobjectattribute entries matching an image filepath and
-     * a contentobjectattribute ID
+     * a content class attribute ID
      *
      * @param string $filePath file path to look up as URL in the XML string
-     * @param int $contentObjectAttributeID
+     * @param int $contentClassAttributeID
      *
-     * @return array An array of ids and versions of image files where the url
-     *               is referenced
+     * @return array An array of content object attribute ids and versions of
+     *               image files where the url is referenced
      *
      * @todo Rewrite ! A where data_text LIKE '%xxx%' is a resource hog !
      **/
-    static function fetchImageAttributesByFilepath( $filepath, $contentObjectAttributeID )
+    static function fetchImageAttributesByFilepath( $filepath, $contentClassAttributeID )
     {
        $db = eZDB::instance();
        $filepath = $db->escapeString( $filepath );
-       $contentObjectAttributeID =(int) $contentObjectAttributeID;
+       $contentClassAttributeID = (int) $contentClassAttributeID;
        $query = "SELECT id, version
                  FROM   ezcontentobject_attribute
-                 WHERE  id = $contentObjectAttributeID and
+                 WHERE  contentclassattribute_id = $contentClassAttributeID and
                         data_text like '%url=\"$filepath\"%'";
 
        $rows = $db->arrayQuery( $query );
