improved publish script and improuved openImg