There are typically a couple/few reasons this can happen:
1- Pulley teeth are worn down and no longer hold chain in line
2- Pulley isn't installed correctly.
3- Chain is too long, and "droops" off pulley
4- Derailleur hanger is way out of alignment
5- Derailleur cage is bent
Those pictures aren't really good enough to say for sure, but it looks like your derailleur is out of plane, which would be 4 and/or 5 on that list. Even with this being the case, you typically need a bit of 1 and/or 2 to see rubbing like that.
Tech writer/support on this here site. FIST school instructor and certified bike fitter. Formerly at Diamondback Bikes, LeMond Fitness, FSA, TiCycles, etc.
Coaching and bike fit -
http://source-e.net/ Cyclocross blog -
https://crosssports.net/ BJJ instruction -
https://ballardbjj.com/