Moved add_image logic into application.py.