Rotating dynamically fed photo around a center?

I’m doing a little photo rotation front-end for a site I’m working on. It’s a custom photo gallery site that needs to have a photo rotation functionality to it. The back-end developers couldn’t find a decent way to do it in Javascript, so they’ve come to me to figure it out in Flash.

They pointed me to the Flickr rotation tool as an example. Seems like it should be straightforward:

[LIST=1]
[]Load photo into empty movie clip on stage
[
]Re-center photo movie clip to the stage
[*]Use left/right rotation buttons to rotate image in 90 degree increments
[/LIST]

That said, I’m having a tough time, after I load a photo into the empty movieclip, using a rotate left and rotate right button to spin the photo around. Obviously, the registration point is in top-left corner of the photo movieclip when the photo is loaded.

I’ve read that rotation can be managed by putting the clip to be rotated into an outer clip, but…there’s a catch…

…I won’t ever know what the exact size of the photo being loaded is going to be, so I can’t set the outer clip to a certain size. I only know that it will never be wider than 100px.

Any suggestions? I’m trying a few things in the meantime. Any tips would be helpful.

Regards,
IronChefMorimoto