ignore case of file extension

Files with extensions like .JPG (capital letters) were getting directed to the wrong template.  This change adds ignoring of case in the getTemplate function, similar to the getIcon function.