updating for new gallery functionality for wordpress 3.5, galleries with ids and with no ids in shortcode