Standardize select image from media db/show preview process.

This used to be two seperate processes for the category icon and
images selected in plugin/theme config. It has now been simplified
to use just one process, which also uses the same markup and JS.

This adds to the consistency of the UI/UX, but it also saves some
CSS and a lot of JS, most of the latter of the expensive kind that
modifies the DOM.
Remove stray debug code.