Major issue with resizable containment

Major issue with resizable containment


Hello all,
I have an application that dynamically adds images to a container. The
images are set to be both resizable and draggable. I'm trying to make
it so that the user can't put any part of the image outside of the
container, but I'm having major difficulty, as the resizable plugin
allows my images to resize out of the container. This appears to be a
bug in the latest version of the jquery ui code from the site. Anybody
have an idea how I can fix this? I've been having problems with this
for a couple of months. Here is a snippet of the code I'm using to do
this:
//ImageName is a the name allocated to the image in the previous step
when the image was created.
//#EditorDiv is the container div I'm using. The images should not be
resizable out of this div (it is 300X300).
$("#" + ImageName).resizable(
                { aspectRatio: true,
                    containment: $("#EditorDiv"),
                    animate: 'slow',
                    maxWidth: 300,
                    maxHeight: 300,
                    revert: true
                })
                .parent().draggable({
                containment: $("#EditorDiv"),
                revert: "true",
                cursor: "move"
            });