modified registimages.py