Rewrote imagedb.js to more async, added edit fields, bugfixes, etc