Smarter image resize.