Added "manual search" for gallery view since getLayout does not get index on change of view