Foreach Javascript Array Find Duplicates In Iphoto