*TMI PIC* constipated baby

Ch
So my daughter occasionally gets constipated but it's becoming more and more common for her. She also has mucus but she's teething and is constantly slobbering on everything which apparently can cause that. Her diet consists of mosy earths best brand formula, occasionally i'll add some rice cereal but it's rare (also heard this can cause constipation) and occasional baby food. She just turned 5 months old. If it continues I'm taking her to the doctor. But in the mean time, other moms get this problem, what do you do? What works for you?
Here's the nasty pics. She let out a GIANT poop today. I feel bad for her butthole. :(