Make extension optional on from_file_object