Modified sciencetimeline_funcs in order to implement the image writer thread