The old code don't resize correctly if you use params in request. because if '200' > 500 => return True Now we force the casting to int to be sure to compare apple to apple. before: /web/image/<id>?height=100 => don't return an image with height=100px after: /web/image/<id>?height=100 => return now an image with height=100px