Fixes concurrency problem with branches in broker
Removes old images