Your example does not contain an exessive use of the indefinite article "a." It is natural and correct.
If there was only one flashcard in the set with a policeman on it, it is also correct to say "the flashcard," but then one must be prepared to explain the significance of that specific flashcard, i.e. that this is a set and that there is only one like it in the set. That seems like excessive explanation, since the flashcard was not the point of the story; the important point was the question it raised in Peter's mind. For this reason, I think it is quite appropriate to say "a flashcard."
It is not possible to change any of the other indefinite articles because there are any number of pictures of policemen that can be put on flashcards, and any number of policemen whose pictures can be used. In those cases, one must use the indefinite article "a."
There is a way to tighten up that little story. Remove the word "and" between "lesson" and "when," like this:
Once we were covering different professions during the lesson. When
Peter saw a flashcard with a picture of a policeman on it, he asked,
"Have you heard about the recent riots in the USA sparked by the death
of George Floyd?"
See how that freshens it up? You no longer notice all the indefinite articles. But if it really bothers you, you can put "the" in front of "flashcard" and explain when/if someone asks. On second thought, it would sound natural, too.