Both variants are possible.
In the variant with side protections, the soldiers at the flanks would hold their shields to their sides. This made the top protection a bit worse and reduced mobility, but provided better protection. Sometimes soldieirs at the rear of the formation would also walk sideways to keep the back protected as well.
No one is carrying two shields. The shields are big enough to overlap in a close formation. Look closely at the legs at the front. You'll notice three legs for the three shields there, one front, one side, one top. The first holds it to the front, the second to the side and the third on top to also cover the two people before him. You can see, these people aren't fully trained to form a testudo as there is a noticeable gap here at the side.
Shields on top also aren't missing, they are just less dense. In a close testudo formation the shields can overlap providing additional protection, with side protections, you lose those overlaps.
You can also find many images of a variant with no side protection, which is more mobile and provides better shield density at the top of the formation. It would generally be used in sieges, due to little trouble coming from the sides. The variant shown here is a more loose testudo formation, which would be used for storming a position, it's so loose as to avoid overlaps of the shields, this gives the soldiers the highest possible freedom of movement and speed while in this formation.