I have a photoshop file with 200 layers of pics arranged in a grid that I've imported as a comp to keep each layer intact.
What I want to do is automatically randomize the Z axis of each picture and then fly a camera layer around inside them.
Can this be done?
Put your pictures in a precomp and try the Card Dance effect on the precomp. I think you'll like it.
You will want to create a second precomp and in it make a layer with turbulent noise applied (or fractal noise, a gradient, whatever you want) and use the values of that precomp to drive the z axis of each of the cards.
To expand on Szalam's post: If you use Card Dance/ Card Wipe, it would be sufficient to import a flat graphic. The technique is also used in this old Ayatoweb tutorial. Of course, if you need more fancy layouts with proper 3D interaction, then each layer will have to be used as a native 3D layer. In that case expressions would be the way to go. Let us know what exactly you need.