Unity new ui Drag and drop

Hi all, i am using unity’s new ui to implement drag and drop feature for learning.The problem i am facing is that when i drag a image out of placeholder and drop on empty space it sticks to that as in image.

But if i drag another image and drop it on above any five slots, it successfully placed.Also if i swap two images, one goes to below of that image.Like this,

What i am trying to do is to implement like card games like solitaire.Here is the code.
This script goes to image objects like in A, B etc.

public class DragHandler : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDragHandler
{

public static GameObject itemBeingDragged;
Vector3 startPosition;
Transform startParent;

#region IBeginDragHandler implementation

public void OnBeginDrag (PointerEventData eventData)
{
	itemBeingDragged = gameObject;
	startPosition = transform.position;
	startParent = transform.parent;
	GetComponent<CanvasGroup> ().blocksRaycasts = false;
}

#endregion

#region IDragHandler implementation

public void OnDrag (PointerEventData eventData)
{
	transform.position = Input.mousePosition;
}

#endregion

#region IEndDragHandler implementation

public void OnEndDrag (PointerEventData eventData)
{
	itemBeingDragged = null;

	if(transform.parent != startParent)
	{
		transform.position = startPosition;
	}

	GetComponent<CanvasGroup> ().blocksRaycasts = true;
}

#endregion

}

this script goes to placeholders

public class Slot : MonoBehaviour, IDropHandler
{

public GameObject item
{
	get
	{
		if(transform.childCount > 0)
		{
			return transform.GetChild(0).gameObject;
		}
		else
		{
			return null;
		}
	}
}

#region IDropHandler implementation
public void OnDrop (PointerEventData eventData)
{
	if(!item)
	{
		DragHandler.itemBeingDragged.transform.SetParent(transform);
	}
}
#endregion

}

This tutorial can help you =)

Line 31 should be
if(transform.parent == startParent)

@BoredMormon Please what if i want to swap the old tile for the new one i.e the tile dragged by the mouse can be dropped on an occupied space and the tile currently occupying the space would move to the default position of the new tile.

Very good tutorial to how drag and drop and matching object

my problem is the same but slightly different I want to change the image to another image on the on-drop function, I am using the same card script that this guy used it.