Change return format for file_to_memory