implemented client side image resizing