It should be noted, that this function returns array of WP_Post objects, indexed by their ID, ordered by their “menu order” by default – that is where usually plugins handling attachment store their order positions…