Original query:

Indexes:
    "images_pkey" PRIMARY KEY, btree (id)
    "by_cid_status_date_upload_where_del" btree (company_id, status, date_uploaded DESC, id) WHERE deleted_at IS NULL
    "by_company_id_date_uploaded" btree (company_id, date_uploaded) WHERE deleted_at IS NULL
    "by_location_id" btree (location_id) WHERE deleted_at IS NULL
    "creator_date_uploaded_Where_pub_not_del" btree (creator_id, creator_type, status, date_uploaded) WHERE deleted_at IS NULL
    "images_company_creator_date_uploaded_status_not_del" btree (company_id, creator_id, creator_type, status, date_uploaded) WHERE deleted_at IS NULL
    "images_date_uploaded_soft_del" btree (date_uploaded) WHERE deleted_at IS NULL
    "index_images_on_created_at" btree (created_at)
    "index_images_on_creator_id_and_creator_type" btree (creator_id, creator_type)
    "index_images_on_date_uploaded" btree (date_uploaded)
    "index_images_on_location_id_and_deleted_at" btree (location_id, deleted_at)
    "index_images_on_location_id_and_updated_at" btree (location_id, updated_at)
    "index_images_on_md5" btree (md5)