using imghdr to check type