class ImageUtils {

    public static List<File> listImageFiles(final File directoryFile) {
        log.debug("Listing images in directory {}", directoryFile.getAbsolutePath());
        File[] files = directoryFile.listFiles(ImageUtils::isImage);
        if (files == null) {
            files = new File[0];
        }
        final List<File> result = Arrays.asList(files);
        log.debug("Found {} files in directory {}", files.length, directoryFile.getAbsolutePath());
        return result;
    }

}