Frontend tweaks: fixed issue where flash ends before the photo is taken....

... Now the screen remains white until the image is ready to display. Refactored some state variables out of the view.

The frontend has a lot of work to do... :)