Fixed a bug check of imagesize