In the photographs, he was seen dancing to the tune of a dhol(drum) in a huge crowd.
"That's the day for me at a shoot for a small appearance in a film being made by Sanjay Dutt...a gesture to be alongside him in his hour of trying times," Bachchan posted on his blog srbachchan.tumblr.com Friday night.
The 71-year-old also added that once he is in front of the camera, he forgets everything and just performs.
"Despite all the discomfort of the body when the camera rolls, the body rolls too ... I have just sufficient time to do just this for today ... but hopefully more will follow soon," he said.
As reports suggest, Big B will be playing himself in the film that is reportedly titled "Big B".
Sanjay is currently serving a jail sentence in connection with the 1993 Mumbai bomb blasts.