Fix image resizing and clean up