I figured it out. It was a careless mistake of not setting the $img->owner_guid to the $group->owner_guid. I had it set to $group->guid on accident.
I am still curious as to why $img->delete() returns 'false' even when it does successfully delete the icons for that group though (I have it in my owner php script so that I can call it by using jQuery).
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by Raül Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.