[ticket/11145] Wrong error thrown when uploading a bigger image.

When attaching an image to a post with a size larger than maximum defined in
php.ini, 'ATTACHED_IMAGE_NOT_IMAGE' error is thrown. This is because is_image()
method is returning false value for uploaded image. Image test is done by
using mime type and it is not set properly in $_FILE as uploaded file is
too large. Added a separate method to test weather uploaded image format is
valid.

PHPBB3-11145