added functionality for img tags to work properly