Reworked logic for determining whether the figure will be in
the top and bottom row on the page. Old code only worked correctly
for par(mfrow=c(r,c)) not for par(mfcol=c(r,c)).