FileNotFoundError in api.media_upload using the file argument
I tried to upload an image created in memory by using the file argument of `api.media_upload` 


code:
```python
import tweepy
from PIL import Image
import numpy as np
import io

consumer_key=""
consumer_secret=""

access_token=""
access_token_secret=""

auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)

api = tweepy.API(auth)
    
X = array = np.random.randint(255, size=(900, 1600, 3), dtype=np.uint8)

im = Image.fromarray(array, mode="RGB")
    
b = io.BytesIO()

im.save(b, "PNG")
b.seek(0)
fp = io.BufferedReader(b)
    
media = api.media_upload('test.png', file=fp)

api.update_status("message", media_ids=[media.media_id])

```

returns Error:

```
Traceback (most recent call last):
  File "/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/main.py", line 42, in <module>
    main()
  File "/main.py", line 36, in main
    media = api.media_upload('test.png', file=h)
  File "/tweepy/api.py", line 225, in media_upload
    file_type = imghdr.what(filename) or mimetypes.guess_type(filename)[0]
  File "/lib/python3.8/imghdr.py", line 16, in what
    f = open(file, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: 'test.png'
```

diff --git a/tweepy/api.py b/tweepy/api.py
index 4a2599c..66e95d2 100644
--- a/tweepy/api.py
+++ b/tweepy/api.py
@@ -221,7 +221,12 @@ class API(object):
         """
         f = kwargs.pop('file', None)
 
-        file_type = imghdr.what(filename) or mimetypes.guess_type(filename)[0]
+        h = None
+        if f is not None:
+            location = f.tell()
+            h = f.read(32)
+            f.seek(location)
+        file_type = imghdr.what(filename, h=h) or mimetypes.guess_type(filename)[0]
         if file_type == 'gif':
             max_size = 14649
         else:
['tweepy/api.py']