Improving attributes handling for a and img tags