Get pixel dimensions from content NOT from EXIF + other EXIF improvements

I was trying to fix issues with unclosed images. However, there are still errors like

> PIL/Image.py:1780: ResourceWarning: unclosed file <_io.BufferedReader name='someimage.jpg'>

see https://github.com/python-pillow/Pillow/issues/477