Calculate the preview frame from the current device screen size

Closes issue #91