Added set and remove image observer. Improve closing server and destroy variable.