fixed bug in image path uploading and deleting from database