Even knowing the lock anchor trick, occasionally a picture will just want to "be someplace" other than where you want it to be. This happens especially if you're using paragraph styles with orphan control or "keep lines together" or "keep with next" setup in the same area as the picture, ... but sometimes happens for no apparent reason.
Often when "strange things happen" if you make the picture rather small, re-position and then lock (or re-lock) the anchor, and then resize to what you want you can lead it back into better behavior; but I really haven't figured out why it goes berserkers occasionally to begin with.
If you make a lot of "image changes" while you're relying on autosave occasionally it seems to throw a clinker or two. Often a Save, and for some reason scrolling up or down a few pages and then coming back to the picture, will reorient things.
Sometimes you just have to mumble at it for a bit.