Put Mac disk image creation into separate function in common tools

Change-Id: I45e748cce71feb9eb951d40971817badbb448fef
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>