revised image resizing / improved image scaling performance