Moved popup HTML into a discrete string variable to simplify modification. Added a div container for selectable images. Changed default uploadUrl to PHP script name. Changed :button search from children() to find(). And added a  object container to reference the image selection container in the dom.