A crackdown on drugs and improved staff training will be put in place at a Manchester prison after a damning inspection.