I have an image being hacked in as a background image (as shown here). I\'ve noticed that if I drag my mouse over it though, it selected the image so that it can\'t be deselect
If you are using jQuery I've written a tiny jQuery plugin - wrapper that does pretty much what ppumkin wrote:
(plugin is in js part along with an example usage) http://jsfiddle.net/gryzzly/HtvB8/