This should work:

vec_to_angle (pictureentity.pan, pictureentity.x);

If the rotation center isn't 0,0,0 you have to use the difference between the center position and your entity position. Also, you might have to invert the pan angle after doing this in case it ends up being facing the wrong direction.