global.js: fix several avtar showing bugs