Added background operation so UI doesn't lock up.

Analyzing the image is blocking, so I moved it onto a backgrounded queue to have a smooth user experience.