add imgLoaded property, fixed end frame bug, optimize callback function call