test or check an image file for find its format