Don't loose precision when parsing image size on 32 bit machines. Presumably fixes #8979.

Signed-off-by: Recursive Madman <recursive.madman@gmx.de>
Merge pull request #9064 from recursive-madman/patch-1

Proposed fix for #8979