inserting the new node using the range, this lets us maintain the cursor position and insert the image at that location