Use static function to check for image extension