Getting rid of data is in the laravel docs: https://laravel.com/docs/9.x/eloquent-resources#data-wrapping
Just add JsonResource::withoutWrapping(); to the boot method of your AppServiceProvider and it won't be there. It will be there if you paginate though.
And the best way to implement your Bonus section is through a resource. Just specify which attributes you want to return on a MediaResource and don't include the ones you don't want.
//MediaResource
public function toArray($request)
{
return [
'preview_image' => $this->getUrl('preview'),
];
}
//AccountResource
public function toArray($request)
{
return [
'profile_image' => MediaResource::make($this->whenLoaded('profileImage')),
];
}