Its possible, however, this formula is simply based on my findings in Comment 32 of the bug:

https://bugzilla.mozilla.org/show_bug.cgi?id=933902#c32

It seemed to be based on taking the larger side, but since I don't have any devices with preview sizes that would go against this rule, its impossible to know if that is the case for sure.