fork from code.google.com/p/jquery-imagetool/