Fixed trivial scale.

When doing a resize and the source and destination images are the same size
in one dimension, the code used to just do a memcpy (incorrectly).  Previous
changes removed this and asserted against the case.  This change handles the
case more intelligently and minimizes the number of copies that are made
when this happens.