distinguish file and image type