Effect of nanostructuration on the spin crossover transition in crystalline ultrathin films