Get filetypes from directory

Checks folder dir for .jpg and returns # of found files with the
matching extensions.