New future for old primary school in Dumfries and Galloway as communities benefit from Scottish Land Fund