Bug 848916 - don't open images that are too big r=dkuo(cherry picked from commit 42a42678460ca9c04add2485823222113003dd6c)
(cherry picked from commit 81477ddd436aab2df616a8faadd850c76cf1e7a6)
Merge pull request #8752 from davidflanagan/bug848916-v1.0.1

Bug 848916 - don't open images that are too big r=dkuo(cherry picked fro...