FB-14497: Fixed gallery wrong image after click.