added support for attaching photo to email, bug fixes