Fixed #19457 - ImageField size detection fails for some files even when PIL could succeed

https://code.djangoproject.com/ticket/19457