Fix wrong offset bug on expand images