diff --git a/telethon/utils.py b/telethon/utils.py
index <HASH>..<HASH> 100644
--- a/telethon/utils.py
+++ b/telethon/utils.py
@@ -678,7 +678,8 @@ def _get_extension(file):
         # Note: ``file.name`` works for :tl:`InputFile` and some `IOBase`
         return _get_extension(file.name)
     else:
-        return ''
+        # Maybe it's a Telegram media
+        return get_extension(file)
 
 
 def is_image(file):
Fix is_image not considering MessageMedia objects

This was causing albums with MessageMedia objects to fail.