add all important variables to a global MoeChat object and use custom image upload code