Change image_to_ppm signature

Now takes a file pointer as an argument instead of returning a string.