When using ng-repeat to populate a list of images, I am encountering an issue with $index not replacing in the mouseover section but working fine in the name section. Can you suggest possible reasons for this inconsistency and how it can be corrected?
<img onmouseover="preview.src=img{{$index}}.src" name="img{{$index}}" src="{{image.SMALL_PATH}}" alt="" ng-repeat="image in images | filter:query"/>
<div class="preview" align="center">
<img name="preview" src="images/img1.jpg" alt=""/>
</div>