Fix typos
Simplify code in thumbnail()

Until $thumbnail is resized,
$thumbnail->getSize() is the same as $imageSize.
Change code ordering

Prevalent mode first, consistency.
Prepare for upcoming THUMBNAIL_UPSCALE setting
Add THUMBNAIL_UPSCALE setting

This setting allows upscaling the source image if needed,
so that the result matches the requested size instead of being smaller.
Add fallback to default mode

This allows to omit the mode when using other settings:
    thumbnail(..., THUMBNAIL_UPSCALE)
instead of:
    thumbnail(..., THUMBNAIL_INSET | THUMBNAIL_UPSCALE)
Fix unit test
Add unit test for invalid thumbnail mode
Support previous values of thumbail mode constants
Tweak the thumbnail mode check
Move the thumbnail mode check to a separate method