Restoring the gallery position after global browser resize