Update main.py

Fixed many errors concerning the displaying of images