Updating gallery.js to better handle flickr outages and empty galleries