I've stored all my images in database (Mysql), but when I whant to see that image with Fancybox, it display only the binary data, not the image.

My code:

```
<a href="/controller/action/id" class="group" rel="fancy">
    <img src="/controller/action/id/thumb" />
</a>

```

For url "/controller/action/id" I use this code to return the image:

```
header("Content-type: {$image['Image']['image_type']}");
echo $image['Image'][ $size ];

```

I use CakePHP.

Thanks.