Fix artefacts index view when need_ids is nil

This was causing 500 errors in prod.

need_ids should always be an array, but in some cases it can be nil
(often caused by Rails params_wrapper 'helpfully' converting empty array
in JSON requests to nil).