The quasi-two-dimensional nature of LaNiO3 (LNO) thin films on SrTiO3(001) (STO) and LaAlO3(001) (LAO) substrates is examined. Although both samples undergo a metal-insulator transition with decreasing thickness, the spatial distributions of the insulating phase within the films differ from each other. The LNO cell volume of the insulating phase in LNO/STO is larger than that of the metallic phase, and the large cells remain at the interface in thick films with metallic conduction, suggesting a high oxygen-vacancy content at the interface. The cell volume of the insulating phase in LNO/LAO is smaller than that of the metallic phase, and the cell volume of the entire film changes coherently. The cell-volume decrease indicates that the bonding changes from bulklike to covalent.