5 month old rolling and moving in his sleep

Shelby

Our five month old has always moved a lot in his sleep. Before he started rolling he would scoot so his body would be laying in his crib where his legs and head would touch the sides. Now he’s started rolling over in his sleep and his leg got caught in the pegs. Has anyone else had this problem and found a solution? I don’t want him getting hurt at night with all of his wiggles. He’s in the 90th percentile for height so he bangs his head a lot too.