Improve camera flash checking code.

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>