Funny, noticed that today too, i suspect it adds the files A-Z and it just replaces what was there before. like, say before you had B.png and nothing else and then you add A.png, B would've been in the first slot but gets replaced with A and then B gets the second one. And therefore it gets confused if the badge is already used.
2 Possible fixes, either gytb gets updated (surely badge arcade must have handlet it a bit different to not cause this problem)
or you try to change the names so that new badges are alphabetically last