image capturing function added. images are rotated 90 degrees to the
right. 
need to fix this.