Hopefully this is not confusing.
---- WHAT I need is this below ----------------
SQL Statement
Select * from table_mains
left join table_a where table_a.id = table_mains.table_a_id
left join table_b where table_b.id = table_mains.table_b_id
left join photo pa where pa.id = table_mains.photo_a_id
left join photo pb where pb.id = table_mains.photo_b_id