Fixed #19457 -- ImageField size detection failed for some files.

This was caused by PIL raising a zlib truncated stream error since we fed
the parser with chunks instead of the whole image.