replaced imageCounter with 9 because there are only 9 img tags.