Hi Guys though I posted the question looking for the answer but I found the answer myself To set the boot system variable I was using the statement
switch(config)# boot system bootflash:Image.bin
switch(config)# boot system bootflash:Image.bin
Instead of that the command to set the boot variable is
switch(config)# boot system flash bootflash:Image.bin
switch(config)# boot system flash bootflash:Image.bin
and then everything worked fine.