public static function resizeImageDirectory($dir, $desiredWidth = 200, $overwrite = false, $recursive = true, $subDir = 'resized') {
        foreach (self::readDir($dir, self::FILES_ONLY, $recursive, null, true) as $path => $filesArray) {
            foreach ($filesArray as $file) {
                $destination = null;
                if (!$overwrite) {
                    if (!is_dir($path . $subDir)) {
                        mkdir($path . $subDir);
                    }
                    $destination = $path . $subDir . DIRECTORY_SEPARATOR . $file;
                }
                self::resizeImage($path . $file, $desiredWidth, $destination);
            }
        }
    }