Cleanup regenerating thumbnails and use more WP function