added image check for files