Fix for #937

As I mentioned in 0640bca81d16361630ff326cadc9d47a3125b932 I encountered some errors. I figured out the url check for thumbnails is not made properly. The REQUEST_URI variable is not started with /thumbs when Bolt is running from a subdirectory. I also used timthumb.php-s check for proper url format beacuse I think we don't want malformed thumbnail url-s to redirected to timthumb.php.