title: Silex Help. Could anyone explain why I'm getting a 404 error here?
body: <p>I am making a <code>Silex</code> application which takes a random image from a database and then displays it on the webpage. But I keep getting a <code>404 error</code> when trying to display the image. Here's my routeing code.</p>
  
  <pre><code>&lt;?php
  
  use Symfony\Component\HttpFoundation\{Request, Response};
  
  $app-&gt;get('/{width}/{height}', function (Request $request, Silex\Application $app, $width, $height){
  
      $image = $app['db']-&gt;fetchAssoc("SELECT filename FROM images ORDER BY rand() LIMIT 1");
  
      $placeholder = $app['image']
          -&gt;make(__DIR__.'/../public/img/' .$image['filename'])
      -&gt;fit($width, $height)
      -&gt;greyscale()
      -&gt;response('png');
  
  
      return new Response($placeholder, 200,[
          'Content-Type' =&gt; 'image/png'
      ]);
  
  
  })-&gt;assert('width', '[0-9]+')-&gt;assert('height', '[0-9]+ ');
  </code></pre>
  
  <p>Because I have a route written has width and height I need to put a width and a height after my url do I do not get these errors.</p>
  
  <p><a href="https://i.stack.imgur.com/HetEN.png" rel="nofollow noreferrer">Errors page</a></p>
  
  <p>But then once I do add the height lets say, 400 and 400, I get a 404 error page</p>
  
  <p><a href="https://i.stack.imgur.com/wtequ.png" rel="nofollow noreferrer">404 Page</a></p>
  
  <p>Could anyone provide help?</p>