Isn't it a bit overkill to pull these functions out of image.c? The only reason i added them was so i wouldn't forget  fread/write's weird arguments. Also I rely on file_read printing an appropriate error on EOF.