fix #38, add image name checking when close image span