If I understood your requirement correctly, while publishing the binaries dynamically, you want to avoid the dependent items to go to publishing.
So if you want to achieve it using custom resolver. One point to mention here is: In case you have multiple publishers, deploy the custom resolver to all your publishing servers as explained here.
I am sharing a simple example code, which should work for your requirement.
public void Resolve(IdentifiableObject item, ResolveInstruction instruction, PublishContext context, Tridion.Collections.ISet<ResolvedItem> resolvedItems)
{
// Check if published item is multimedia component
if (item is Component)
{
Component comp = (Component)item;
if (comp.ComponentType == ComponentType.Multimedia)
{
// Remove all resoved dependent items
// you can remove items selectivly as well, if needed.
resolvedItems.Clear();
}
}
}
You can also have a look here for some example code.