Fixed bug deleting null pointer
Fixed more bugs. Send the type of the image. Print more messages