preserve gallery position