Converting 2D array into 3D by repeating same layer 3 times