Welcome to Health Care Magic
Weight gain and depression
are known issues with 'depo-shot'.
If the original indication is not ameliorated - you should continue the drug and make other attempts at weight reduction.
Weight is like your bank balance - what you put in (eating) and what you take out (Exercise) decide the balance. Even if you are eating the same amount of food, you could gain - if your activities are reduced - for example from your illness.
The very fact you are concerned, shows you have the motivation. The most important thing is food - reduce the quantity and change the quality. A dietician will be great help. With modified food and more exercise, you WILL be able to reduce.
Wishing speedy recovery