working out the bugs from uplaoding images - partially complete