The photograph was taken after the first Apollo CSM/ LM-SIVB separation in Earth orbit. The CSM Gumdrop revolved to examine the LM Spider, still attached to its garage atop the Saturn third stage (SIVB). The Spacecraft LM Adapter (SLA) panels which protected the LM during launch and connected the CSM to the Saturn launch vehicle had already been jettisoned. The CSM then performed the first docking with the exposed LM in order to withdraw it from its shell.
From the mission transcript after CSM/LM-SIVB separation:
Okay. 3, 2, 1 - Bang! It’s gone. [...]
Hey, David, there goes the (garbled) on the panel. See it?
Man, look at that son of a gun go!
Okay, Dave, (garbled) is just beautiful. Just halfway around. Okay, just right there, Davey. Just leave it like it is (garbled) nice and bright there. [...]
Is the camera running?
Turn it on! [...]
Well, our pitch angle isn’t exactly right - it doesn’t look right.
That’s alright; we’re going to fly around a little bit, Dave. [...]
Roger. It (the LM-SIVB)’s out there, and we’re turned around and proceeding with the station-keeping and docking.
Well, that’s looking beautiful, David. I’m going to start the camera again. Well, I’ll wait for a minute here. [...]
Roger, Houston. We are about 25 feet now and closing slowly.
002:58:41 Roosa (Mission Control):
That looks beautiful, Dave.