Image capture added.

MainActivity code refractored