No, this is not a bug but by design. The OP used the wrong syntax, that is all.
Normally, you'd get links like:
* [link text][1]
* ![image alt text][2]
[1]: http://example.com
[2]: http://example.com/image.png
Note the numbered link targets, each coupled with a link text before it; images are just a special form of this syntax. The link targets are using the form [index]: link
.
The editor removes any link target if there is no corresponding link text. Since the OP had used just the link target syntax, they were removed automatically because there were no corresponding link text for them. This allows you remove link text lines in the body of the text, and the editor takes care of the corresponding targets; the rest are even renumbered if you remove links in the middle of the sequence.
The editor only does this on subsequent edits, not for the initial revision; any edit you made would have removed these targets, but you had made one of them into a proper link already.
For next time, remove the [index]:
prefixes first before using the toolbar buttons, or simply insert the image syntax by hand in the editor rather than use the toolbar options.