Gallery2: Fix typo

Assertion to check array boundary should be '&&' instead of '||'.
It caused an exception '-1' that wasn't detected.

Change-Id: I833bbe6ab95728a8007b821dd9bcc337cac345b4