private static int checkAndAddFile(List<File> list, File f) {
        if (Utilities.getFileExtention(f) != null && Utilities.getFileExtention(f).equalsIgnoreCase("PNG")) {
            try {
                BufferedImage image = ImageIO.read(f);
                int w = image.getWidth(null);
                int h = image.getHeight(null);
                if (isPowerOfTwo(w) && isPowerOfTwo(h)) {
                    list.add(f);
                    return -1;
                } else {
                    return 0;
                }
            } catch (IOException e) {
                return 3;
            }
        } else {
            return 1;
        }
    }