Added some image resizing code