FIX: GD - check file exists before getimagesize

Use is_readable to check the file exists and is readable
Merge pull request #3726 from willmorgan/bugfixes/gd-image-exists

FIX: GD - check file exists before getimagesize