Update functions.php

Changed createThumbnail() to support transparent PNG thumbnails.
Agreed.  I'm not sure why I'm using ``preg_match`` here instead of a case-insensitive string match.