remove redundant files and add those to ignore
raise an error for invalid PNM file