+repage for imagemagick and minor js optimization

Change-Id: I12dd2a5553c418612b1af4dbc20f8803440c2677