Added better image resizing