started converting main.py to use imagedb.py