If you want to get attribute id from attribute code, use following code.
$attributeId = Mage::getResourceModel('eav/entity_attribute')
->getIdByCode('catalog_product', 'small_image');
$attributeId = Mage::getResourceModel('eav/entity_attribute')
->getIdByCode('catalog_product', 'small_image');