'Open and yield file for reading the image file for an image
with supplied identifier.
:param image_id: Image ID'

@contextmanager
def open_for_read(self, image_id):

    path = self.get_image_filepath(image_id)
    with open(path, 'rb') as cache_file:
        (yield cache_file)
    now = time.time()
    with self.get_db() as db:
        db.execute('UPDATE    cached_images\n                                                                                            SET    hits    =    hits    +    1,    last_accessed    =    ?\n                                                                                            WHERE    image_id    =    ?', (now, image_id))
        db.commit()
