Nitpick: 24,000 TEUs, or 20-foot equivalent units. Most containers are 40ft or bigger, so its more like 12-15,000. Still a lot, though!
If I am counting correctly, you can see about 209 +2423*9 = 5148 containers.
Still, I am unable to see how 12000 containers would fit the ship.
Edit: I am correct, as you can see in this picture:
https://en.wikipedia.org/wiki/Algeciras-class_container_ship...