bit of a hack to get image type from filesystem