Removed unnecessary double check. Thanks to marcoscoelho for the hint.
Added play-pause control for the Gallery.