media regenerate: remove inline props

code has been significantly altered. will give credit in release post.
use attachment metadata for deleting old images, instead of reading through the existing files
fix indentation for commands/media.php