fix insert_tile query for sqlite
change load order to sidestep flask-testing import side-effect