As far as I understand, all you need to do is erase all references to a resource. For example:
test_image = LoadImage("test.jpg")
DrawImage test_image, 0, 0
test_image = NULL
Flushmem
In the above, setting the test_image to none, and then flushing the memory, would erase your image test_image.