fix img char attribute bug