Change process image to store resized images in a tmp file before moving them to their final location.