I’m going to spout off some vague instructions. I fiddled with this a little, but a lot may depend on your exact workflow.
1. Pre-comp your puzzle piece animation.
2. Duplicate the puzzle piece comp in the master comp.
3. Put your photo in the master comp, below the two puzzle comps.
4. Set the Track Matte option for the photo to be the lower puzzle piece comp.
Side note- make sure the photo’s time bar only begins just before you want the flip to begin. Otherwise you could get some odd results.
5. Make all layers 3D.
6. Change the Z position value of the puzzle piece comps to -.01. This just gives them slight separation in 3D space.
7. Pre-comp this comp.
8. In the new master comp, make the pre-comp 3D and turn on the Collapse Transformations switch.
9. Rotate the comp’s X or Y to create the 3D flip.
It may not be perfect, but hopefully that will get you started.