Move icon check outside of loop to prevent downloading multiple times