from typing import Optional
import imghdr


def find_file_with_imghdr(data: bytes) -> Optional[str]:
    """Find images with the help of imghdr magic numbers
    :param bytestring: Bytes to be examined.
    :type bytestring: bytes
    :return: A string with the file type
    :rtype: str
    """

    res = imghdr.what("", data)
    if res:
        return res
    # try again with a potential padding byte removed
    res = imghdr.what("", data[1:])
    return res