The versions of the telemovie scripts of "In Thy Image" end with Will Decker departing with Vejur (or N'sa) for destinations unknown, while the floating light/probe that took Ilia's form reverts to a small, burnt, pitted, mechanical device lying on the ground. As they commiserate the demise of "Tasha" (named by Chekov because its pearlescent appearance reminded him of an aunt's ring), the real Ilia steps out unscathed, rejoining the crew as a "Phase II" regular.
The plan was to alter the beginning of whichever completed script (of the 12 other teleplays in various degrees of completion) was going to be Episode #2, to explain how Decker was able to return to the ship. Decker was also a continuing character, and would possibly have become the series lead after the initial 13 episodes - if Shatner's movie career took off as he'd planned. Or, Shatner's character would be promoted to semi-regular guest admiral.
The idea that Ilia could could come back from being digitized meant that the three Klingon vessels could also
come back, hence they realized they could
have a last-minute SPFX shoot-out at the end, lest audiences think the Vejur cloud storyline wasn't a big enough finale.