image capture working, needs optimization