Make attachments.php like full-width.php in that it only loads the main template. Main template can check for attachments template, and selectively load it's changes via get_template_part. This will reduce code replication.