Added a check to indentify the valid mask files from whatever binary file