some image cleanup and resizing