copied from http://odyniec.net/projects/imgareaselect for meteorjs package