Merge "Gallery2: Fix NaN comparisons"