From the code below I get the image of a product from a url:
$media = Mage::getModel('catalog/product_media_config')->getMediaUrl($product->getThumbnail());
And with that it returns me the image from the URL by picking directly from the product:
http://urlsite.com/media/catalog/product/u/m/uma-flor-alaranjada-com-mensagem-cart_o-14896928_1_1.jpg
But for my need, in this way, even resizing the image, it gets distorted and I needed to get the image through the cache and in case it would have to return the image from the URL below, however I do not know what I should change to do that:
http://urlsite.com/media/catalog/product/cache/1/thumbnail/50x50/9df78eab33525d08d6e5fb8d27136e95/u/m/uma-flor-alaranjada-com-mensagem-cart_o-14896928_1_1.jpg