Weird baby poop, tmi photo!

Am

2 week old has been on just formula for about a week now due to breast feeding problems. She started finishing every feed and wanting more so we moved up to 4oz as suggested by family members (this is our first baby so we take their advice) and ever since although she drinks it she seems to throw up a bit about half an hour later each time despite burping for long periods, taking breaks and sitting it for half an hour after each feed. Today she seems to have a belly ache or problems pooping, very tearful and seems like she's in pain.Her poop also seems very grainy now too, is this normal or is she not reacting well to the formula? I'm seeing the midwife tomorrow for a follow up to weigh her so I'll mention it then too but I'm very curious.