Use image styles for badge generation in tests here too

This is a follow-up commit to f86afe3