fix gallery close but a line exist issue