Redone image counting to use setMimeData