Effect of the nanofilm thickness on the properties of the two-dimensional electron gas at the interface between two dielectrics