Add image capturing logic