Firefox support and better practices for img tag handling