-from photo, ". (join ",", map{ "tagging ".$_->{counter} } @tags).
-" where ". (join " AND ", map { "$_->{counter}.tag=$_->{id} and photo.id = $_->{counter}.photo" } @tags);
+from photo, ". (join ",", map{ "tagging ".$_->{counter} } @stuff).
+" where ". (join " AND ", map { "$_->{counter}.tag=$_->{id} and photo.id
+= $_->{counter}.photo" } @stuff);