converting display to jpeg or gif file