Calling multiple functions in image upload form
Yes, there's room for a lot of improvement here!

First of all, you can "break early" to avoid excessive indentation. Since die terminates the script, you can check if the file is not valid.

Secondly, instead of echoing first and die later, you can call die with a parameter.

This code works in the same way, but is cleaner:

if (!checkvalidfile("img",$ext)) {
    die("Not a valid file");
}
if (!checksize($size, 524288)) {
    die ("File size is too big!");
}

if (!checkdimensions($tmp, 300)) {
    die("Your image can't be bigger than 300 x 300px");
}

$newfilename = renamefile($ext);
recordfileindb($brand_id, $newfilename, $mysqli);
uploadfile($tmp, $bucket, "user_docs/agency_".$agency_id."/brand_logos/", $newfilename, $s3);
header('Location: ./message.php?action=newlogo');