Implements server-side image resizing