Fix bug with slider not adjusting to correct position on window resize