Follow-up I33462. Some stupid issues with gallery patch

Fix some embarrassing issues with my previous patch

Change-Id: I0a9a58ca854326ea594a9b8bd9499c89a0aca6c3
(cherry picked from commit 63a38f8980e777ec00fa20411d1d61f9d03c7670)