The GIFs are made from frames of the live broadcast of SpaceX JCSat-16 2nd stage around the time of the second engine cut-off (SECO-2).
It looks like the engine moves outward axially as the thrust ends, although I can't be absolutely sure. This is a funny angle - that nozzle is quite foreshortened in this view, and the lens may be a fisheye and quite close, contributing some distortion.
Watching the video on-line the speed telemetry shows the acceleration drop to zero just before the apparent motion. Is this evidence of some kind of spring-loading or deflection of the engine mount?
The camera could be on a mount which is flexing under acceleration, but because of the sort-of binary step nature of the motion, I don't think that's actually what is happening in this case.
Also the engine is gimbaled, and viewing from this angle with a short focal length lens, it is possible that this is actually rotation about a pivot point further to the right inside the spacecraft rather than axial translation.
I'm curious if this motion can be explained as a relaxation of a hypothetical "shock absorber" as discussed in this question after thrust has stopped.
above: Frames from the broadcast changed to monochrome (R+G+B)/3 and stitched manually into a GIF. There are jumps in time due to the editing of the video on line. The launch time code can be used to estimate time.
above: Two frames from the broadcast changed to monochrome (here just the Blue (B) channel only, in order to improve contrast and ignore thermal radiation) selected 50 frames (50/30 ~ 1.67 seconds) apart.
Full video: shown here use the launch time code T+ 00:27:32 to 00:27:38 for reference.