fix gallery #128
fix #128 by hangwen
add remove dom