Absolutely go with the medium. As dogboy said, if it is too small, you can't use it. If it is too large, you can still use it.
I don't know where you are going to get the footed pajamas but there is another possibility. You can order the smaller size and if it doesn't fit, return it and get the medium. Many on-line stores allow returns just because judging sizes on-line is so hard. From personal experience, I find that for some stores, the return procedures are not worth the trouble. But this is another option.