Fixing Memory Leaks /*Free Image Function*/