Unflattens 3D arrays, similar to camera output.