Propagation of optical spatial solitons in finite-size media: interplay between nonlocality and boundary conditions