improve image hinting for 220 preview

Summary: break out the calculation of dimensions as a static method and use it

Test Plan: made a conpherence with many images and noted i auto-scrolled to the bottom correctly

Reviewers: chad, epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2399

Differential Revision: https://secure.phabricator.com/D4733