add env checking in helper and fix can't upload image through api