If one user has many pictures, isn’t it supposed to be HAS_MANY relationship instead of MANY_MANY? Oh well, I am not a relation expert, so feel free to correct me if I misunderstood your situation.
If I understand your problem correctly, I think this is the same with my problem with the ‘current status’, wherein the user has many status saved in the db table but only one should be rendered in the page, whichever status is marked as ‘active’. My workaround for this was to create a separate function to query the active status of the user, which I think is not the Yii-way to solve it.
Apologies if I should create a new issue for this. I just thought that Julio and I have a problem with the same logic, and I hope that answer for his situation will also serve as an answer for me.