image resize ugly as shit. the algorithm should be changed.