I have been trying out the change the flickr image url from the big size to small and medium size without using the image url’s again.I have landed up with the solution.
<?php $url="http://farm5.static.flickr.com/4074/4940684667_9c99ff0288_b.jpg"; echo substr_replace($url,"m",-5,1); echo "<br />"; echo $url; ?>