[MAINT] Add unit tests for image rescaling.

A bunch of fixes.