Refactor non-DRY code to create ImagePlus instances

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
WIP: Populate ImagePlus' FileInfo when converting from Datasets

This fixes a problem where the ImageJ 1.x macro command

	getDirectory("image");

would not report the correct directory, but instead an empty string.

Reported in http://fiji.sc/bugzilla/show_bug.cgi?id=761 by Graeme Ball.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>