The old photo with the cop, the dog and the black man is a poor illustration of the point that I think you are trying to make. Shooting the dog in this circumstance will achieve absolutely nothing (except perhaps escalating the situation and getting you, and/or the black man, also shot). The cop will simply find another way to harass the black man.
A better case would be, say, one where a racist dog owner has trained their guard dog to attack black people. The dog then escapes from their property and starts savaging black people on the street.
In that circumstance would it be right to shoot the dog? Unless there was some other, easy and foolproof way to subdue it - sure, of course it would be right, and completely justifiable. I would be surprised if many people thought differently.