You will need to split mySearch once again at (=) for each name,value pair in order to retrieve the value.
Without rewriting anything.
This modification will work:
And; If you pass the value wrapped in quotes as below.
var mySearch = location.search.substr(1).split("&");
var myPicture = mySearch.split("=");
var myWords = mySearch.split("=");
var pictureFromSearch = myPicture;
var wordsFromSearch = myWords;
You will need to strip those out as well.