Fixed the way that image resizing is handled