images: Correctly copy data smaller than buffer size
images: Correctly copy data smaller than buffer size

Instead of blindly copying the entire buffer size, check the copy offset
against the end of the source data as well.  This is important when the
remaining data to copy is smaller than the buffer.  It would be incorrect
to copy in data from past the end of the source data.

eecsninja/invaders,eecsninja/invaders