Now writes only one temporary image file