Clean up.
Add bulk media actions for detach and regenerate.

This is a bit of a kludge since–as of this commit–there's no proper way
to add bulk actions to the Media page. We can fake it with a bit of
javascript, however.