class ImageHelper {

    public static boolean isImage(String filePath) {
        File imageFile = new File(filePath);
        if (!imageFile.exists()) {
            return false;
        }
        Image img = null;
        try {
            img = ImageIO.read(imageFile);
			return img != null && img.getWidth(null) > 0 && img.getHeight(null) > 0;
		} catch (Exception e) {
            return false;
        } finally {
            img = null;
        }
    }

}