Judge overturns conviction for possession of magic mushrooms and pills