While most infantry officers were mounted, junior officers were not. However, they all carried the same sword, which by regulation was a curved sword and not the same as the cavalry saber, which was longer. NCOs also (officially) carried a sword, which was straight and looked like an 18th century smallsword. The model 1840 comes to mind but that's probably off by a few years. I've never read anything about how officer's obtained their equipment except that there were regulation patterns. Swords were also given as gifts and such were probably not regulation.
The sword in the photo looks older and could have been a family heirloom. Confederate officers had regulation patterns but shortages (of everything) meant other patterns, some imported, were used.
Interesting comment about Lee. I'm looking at a composite print of Lee and his generals, which includes my wife's great-great grandfather, Samuel Cooper (maybe one more great, still not sure after 30 years). Lee is the only one not carrying a saber or wearing a sword belt and sash and he is likewise the only one wearing long trousers instead of boots. They all look overdressed for a summer in Virginia.
Shoot low, sheriff. They're riding Shetlands!
Underneath the starry flag, civilize 'em with a Krag,
and return us to our own beloved homes!
Buy War Bonds.