Using thumbnail functions inside a shortcode

In order to use that function you need to declare this in your theme.

add_theme_support( 'post-thumbnails' );

I tested your code and it works fine, the only way I can duplicate your error is to remove the above.

It might also be because you seem to be using a CPT called “photos”, have you made sure it supports the right parameters, specifically,

// rest of your CPT params
'supports' => array('thumbnail'),

http://codex.wordpress.org/Function_Reference/register_post_type

You can test this quickly by trying,

add_post_type_support( 'photos', 'thumbnail' ) 

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)