Don't depend on case when setting MIME type

Selecting the appropriate MIME type for a file is done by looking at the
file name extention. This is only done for lower case extionsions. The
extionsion might however use different case, such as .JPG instead of .jpg.
We want both to use the image/jpeg MIME type.

Convert the extension to lower case so that it will get the appropriate
MIME type no matter if the extension used upper or lower case.

Signed-off-by: Marcus Karlsson <mk@acc.umu.se>