add the function to remove temporary image file