implement prepare fuunction for picture