Optimized imagemagik invocation

Change-Id: I6fa12b7b4bc943484829ccd78747f3670041a43a