fix image filename length might be too long
fix couldn't select an element if it had a colon in the tag name