I see what you're doing and there is an easier way of doing this. Replace your slider with SMART SLIDER 2. It has different settings including one called dynamic. With this dynamic slider, you can use slides from a category within your site.
I discovered this just last week and I absolutely love the flexibility of this slider. It is rather heavy because of the different features it lets you do. So, if you are worried about that. Set it up as you would want it in a bogus WP site, strip the HTML, PHP, JS, and CSS and migrate it in your site's page. This obviously would be more work but you'll have a smaller code and you don't have to worry about figuring this out.
Good luck