What are some potential drawbacks of allowing images from one's website to be embedded on other sites as a form of advertising?

Potential drawbacks of allowing images from one's website to be embedded on other sites as a form of advertising include increased bandwidth usage, loss of control over where the images are displayed, and potential copyright infringement if the images are used without permission.

<?php
// Implementing hotlink protection to prevent images from being embedded on other sites
$referer = $_SERVER['HTTP_REFERER'];

if(!empty($referer)) {
    $allowed_domains = array('example.com', 'subdomain.example.com');
    $parsed_url = parse_url($referer);
    $referer_domain = $parsed_url['host'];

    if(!in_array($referer_domain, $allowed_domains)) {
        // Redirect to a default image or display an error message
        header('Location: default_image.jpg');
        exit;
    }
}
?>