When does executing a search warrant allow photographing everyone on the premises?

This story(*) concerns execution of a search warrant at the clubhouse of the Outlaws motorcycle club in Waterbury, CT during the club’s christmas party.

Recently, law enforcement in CT has seemed to get very concerned about the Outlaws club. Although there have been no news reports of gang activity or violence, officials have been very active in pressuring the club.

I do not want to debate the Outlaws, or motorcycle clubs/gangs in general.

The aspect of the story that seems odd is the police insistance on documenting each and every person at the party. For instance:
[ul]1. The warrant was obtained to search for firearms owned by a member who is a parolee. The member was not arrested and no weapons were found.
2. The execution was specifically timed to coincide with the party. Although the timing of executing a warrant is at the convenience of the police, it seems that the police were attempting to find as many people at the premises as possible.
3. Every person was photographed before they were allowed to leave.[/ul]
I am interested to know if that last point is legal. It is almost as if they are attempting to assemble a “gang profile” on a group that hasn’t yet broken any laws. Pro-active mug shots, in a sense.

Also, does it not seem that the warrant was obtained in bad faith? If an official tells a judge “we want a warrant to look for X” and they happen to come across Y, that’s legal, correct? What happens if they tell a judge they are looking for X when they don’t care about X and are really looking for Y?
*warning: registration required