Help for this page
$longways = $widthIsLonger ? $width || 1 : $height || 1;
$longways = $widthIsLonger ? ($width || 1) : ($height || 1);