Refactors generate_img.py to use more global consts