[ticket/11148] Use fileinfo for assessing corrupted mime type

Some browsers, namely the standard Android OS browser, do not supply
a proper MIME type while uploading images. With this patch we'll try
to acquire the correct MIME type if the MIME type was either not
supplied ('application/octetstream' by default in phpBB) or if the
browser only supplied the standard 'application/octet-stream' MIME
type.
This is done by passing the path to the image to filespec::is_image()
as an argument. The argument was set as an optional argument in order
to keep backward compatibility with older uses of that function.
Appropriate tests have been added.

Ticket: http://tracker.phpbb.com/browse/PHPBB3-11148

PHPBB3-11148