fixed image list undefined bug and added count