Pictures just show back view of switches without wires.
For each lamp the arrangement is basically...
Line --- Switch A ----Switch B ---- Lamp----Neutral
Notice no need for Neutral in either switch box.
There should be two paths for the live (line) to pass between Switch A and Switch B so that when you throw either switch the state of the light will change. Usually the two paths are on a single cable (Red-Black-Earth) which means that the black wire sometimes carries the live power so this must be indicated by placing a sleeve (often Red but could be Brown) over the Black wire at each end to show it's dangerous and not acting as a Neutral.
Draw the circuit on a piece of paper. Identify the wires. First LIVE which should appear at only One Switch. Then the cable that runs between the switches. Then the conductor that takes power off to the lamp from the other switch. DO NOT GUESS.
Your problem is complicated because you have two lamps and two switches in each wall box. Consider a certified person to make this repair (two black wires in a terminal block is very scary and suggests a very non-standard installation and so does Yellow!) and remember Hilare Beloc's poem...
Lord Finchley tried to mend the Electric Light
Himself. It struck him dead: And serve him right!
It is the business of the wealthy man
To give employment to the artisan.
Peccavi
October 2008