bool isImage(String path) { bool output = false; imageFormats.forEach((imageFormat) { if (path.toLowerCase().contains(imageFormat)) output = true; }); return output; }