Added error message for empty '$imageDirectories'.