That should work perfectly. If you use the relationship settings I had before, you can safely use mainphoto_id. Honestly, it's how I would configure the tables. It just slipped my mind.
Using a join field still might be better, but it's up to you which you prefer.