fixing bugs in preview, resizing imagemagick method