fix bug in check image type