Fix T81494
When switching in Image Texture Node 'Single Image' to 'Generated' and after 'Generated' to 'Single Image' this shader result as pink color.
Solution
Created ima->last_filepath variable for save last filepath before switching to Generated. And back restore filepath
when change to Single_Image.
This ima->last_filepath variable avoid saving img->filepath and not affected other applications.
And the scope this variable only handled wher img->source equal generated image in BKE_image_signal function.