Gravitationally lensed quasars and supernovae in future wide-field optical imaging surveys