def METHOD_NAME(self, lastchange=None):
    """Connect to host and get meta information."""
    headers = {}
    if lastchange:
        headers['If-Modified-Since'] = lastchange.strftime(RFC_1123_DT_STR)
    self.urlobj = urlopen(self.url, self.scraper.session,
                          referrer=self.referrer,
                          max_content_bytes=MaxImageBytes, stream=True,
                          headers=headers)
    if self.urlobj.status_code == 304:  # Not modified
        return
    content_type = unquote(self.urlobj.headers.get(
        'content-type', 'application/octet-stream'))
    content_type = content_type.split(';', 1)[0]
    if '/' in content_type:
        maintype, subtype = content_type.split('/', 1)
    else:
        maintype = content_type
        subtype = None
    if maintype != 'image' and content_type not in (
            'application/octet-stream', 'application/x-shockwave-flash'):
        raise IOError('content type %r is not an image at %s' % (
            content_type, self.url))
    # Always use mime type for file extension if it is sane.
    if maintype == 'image':
        self.ext = '.' + subtype.replace('jpeg', 'jpg')
    self.contentLength = int(self.urlobj.headers.get('content-length', 0))
    out.debug(u'... filename = %r, ext = %r, contentLength = %d' % (
        self.filename, self.ext, self.contentLength))