I am using the following code in my controller:
//function to protect images from being accessed directly.
function getImage($img_id){
//code to auth
you sure the image can be accessed via $this->data['base_url'].'system/application/images/c/thumbs/obama.jpg , you tried accessing it on browser, right?
Also, avoid printing text before rendering the image, it may corrupt the image.
If still doesn't work, let us know the error page screenshot, whats its saying.