first attempt at the 'file_image' function