diff --git a/src/eog-scroll-view.c b/src/eog-scroll-view.c
index 84f6210..a2b67dc 100644
--- a/src/eog-scroll-view.c
+++ b/src/eog-scroll-view.c
@@ -283,13 +283,13 @@ update_scrollbar_values (EogScrollView *view)
 
 	if (gtk_widget_get_visible (GTK_WIDGET (priv->hbar))) {
 		/* Set scroll increments */
-		page_size = MIN (scaled_width, allocation.width);
-		page_increment = allocation.width / 2;
-		step_increment = SCROLL_STEP_SIZE;
+		priv->hadj->page_size = page_size = MIN (scaled_width, allocation.width);
+		priv->hadj->page_increment = page_increment = allocation.width / 2;
+		priv->hadj->step_increment = step_increment = SCROLL_STEP_SIZE;
 
 		/* Set scroll bounds and new offsets */
-		lower = 0;
-		upper = scaled_width;
+		priv->hadj->lower = lower = 0;
+		priv->hadj->lower = upper = scaled_width;
 		xofs = CLAMP (priv->xofs, 0, upper - page_size);
 		if (gtk_adjustment_get_value (priv->hadj) != xofs) {
 			value = xofs;
@@ -310,12 +310,12 @@ update_scrollbar_values (EogScrollView *view)
 	}
 
 	if (gtk_widget_get_visible (GTK_WIDGET (priv->vbar))) {
-		page_size = MIN (scaled_height, allocation.height);
-		page_increment = allocation.height / 2;
-		step_increment = SCROLL_STEP_SIZE;
+		priv->vadj->page_size = page_size = MIN (scaled_height, allocation.height);
+		priv->vadj->page_increment = page_increment = allocation.height / 2;
+		priv->vadj->step_increment = step_increment = SCROLL_STEP_SIZE;
 
-		lower = 0;
-		upper = scaled_height;
+		priv->vadj->lower = lower = 0;
+		priv->vadj->upper = upper = scaled_height;
 		yofs = CLAMP (priv->yofs, 0, upper - page_size);
 
 		if (gtk_adjustment_get_value (priv->vadj) != yofs) {
