Optimized code in content.js and options.css

Deleted unnecessary code and optimized the use of the imageCounter
variable.