Fixes #528 Fixes modal to resize page if not enough room to fit modal