SustainDiffusion: Optimising the Social and Environmental Sustainability of Stable Diffusion Models