You can't spot reduce fat nor can you spot gain fat. If you gained weight, there isn't a guarantee where it will be put on. You can target muscle growth and this may be a better option for you. Muscle hypertrophy is something to look into, you'll gain muscle, therefore weight, and will do so safely. This is ensuring you are eating enough food and relatively healthy foods. You could then incorporate protein powders which generally help with muscle growth.