[IMPR] reduce code complexity of imageharvest.py
[IMPR] reduce code complexity of imageharvest.py

Change-Id: I3200e4655310e5cd2a9caaa70d1f3de2c7e7e554

wikimedia/pywikibot-core,wikimedia/pywikibot-core