Added a buffer and building an image on seperate thread