A model for ripple instabilities in granular media