added type check to look for objects with _getitem_ Fixes #7985

Fixes #7985
``` python
>>> d[1].subs(d, {1: 2})
{1: 2}[1]
>>> type(d[1].subs(d, {1: 2}))
<class 'sympy.tensor.indexed.Indexed'>
```