optimizes script to target li instead of img