Use modulo division to calculate adjustment

This is a textbook case for modulo and has the additional benefit of the smallest margin necessary being set (between `0..(baseline - 1)`) while continuing to work for images with a height < baseline.