They didn't use that as an indicator of depression. All they did was pass into the model the number of faces in the frame. The analysis afterwards suggested that depressed people tend to not have group photos.
It's not like a single marker determines everything.
It's not even like having ALL markers means one is 100% depressed.
It merely gives you a confidence score in the person being depressed.
People who don't hang out with other people are more at risk for depression AND they are less likely to have group photos.
This is called a latent variable.