our brain is pretty amazing, but in this case it is just a crafty set of repeating pictures, not our brain, that is doing this. If you save the .gif to your computer and look at the separate frames, you see that for any frame besides the one where you see her side profile, depending on whether you decide to call the straight leg the right or left one (it could be either) it could be a picture of her facing towards or away from you. Basically, if you look at it when it is paused, however many degrees you perceive her to be facing away from her side profile, the picture could plausibly represent her facing that many degrees towards or away. This explanation sounds way more complex than it is, just try clicking and dragging to stop it from moving and you will see what I mean.