def image_headers(filename):
    return {'X-Timestamp': time.time(), 'Content-Length': os.path.getsize(
        filename), 'Content-Type': 'image/jpeg'}
Create a mjpeg stream from jpeg images in python