That should be just fine. You could connect all the unused pins to ground which you have on the outer two pins of the header, but in either case this shouldn't cause you any issues. Any residual readings that you might get on these pins can then be ignored in software.