Update media.php

divided the json return on a_get_list for the select and the get_children, the first return already the count the second need to be counted