Realignment of buttons

Now works with dynamically sized pages.