move to a new method like isImageFile().  Implementation of this check can be a bit refactored (isolate the extension first, then see if it is on the list of supported extensions)