Most viewed photos - Is the code correct?

I am using Tidypics version 1.6.0 on Elgg 1.5 and I feel it is not working as expected. I feel the SQL code is not fine. Taken from mostviewedimages.php

SELECT ent.guid, count( * ) AS views
            FROM entities ent
            INNER JOIN entity_subtypes sub ON ent.subtype =
            AND sub.subtype = 'image'
            INNER JOIN annotations ann1 ON ann1.entity_guid = ent.guid AND ann1.owner_guid != ent.owner_guid
            INNER JOIN metastrings ms ON = ann1.name_id
            AND ms.string = 'tp_view'
            GROUP BY ent.guid
            ORDER BY views DESC
            LIMIT 10

If you run this code the count of first record is only counted. And thus 'ORDER BY views DESC' has no effect.

sql sample result
63 9
61 1
56 1
55 1
50 1
51 1