Corrected gallery bug. Modified index