Which is a better solution for storing images in folders?
I am planing to store my pictures in folders according to their types and sizes:

images/{**OBJECT**}/{**OBJECT_ID**}/{**OBJECT_ID**}_{**SIZE**}.jpg

    // FOLDERS LOOK LIKE THIS:
    images/product/14/14_thumb.jpg
    images/product/14/14_large.jpg
    images/category/124/124_large.jpg
    ...

According to this approach, I can easily reach any object with a small effort:

    function get_image($OBJECT, $OBJECT_ID, $SIZE){
        ...
    }
    // get image
    get_image('product', 14, 'large');

I think it is good enough for me, but I want to be sure... Maybe I am missing something.

So what do you think?
Which is a better solution for storing images in folders?
===

I am planing to store my pictures in folders according to their types and sizes:

images/{**OBJECT**}/{**OBJECT_ID**}/{**OBJECT_ID**}_{**SIZE**}.jpg

    // FOLDERS LOOK LIKE THIS:
    images/product/14/14_thumb.jpg
    images/product/14/14_large.jpg
    images/category/124/124_large.jpg
    ...

According to this approach, I can easily reach any object with a small effort:

    function get_image($OBJECT, $OBJECT_ID, $SIZE){
        ...
    }
    // get image
    get_image('product', 14, 'large');

I think it is good enough for me, but I want to be sure... Maybe I am missing something.

So what do you think?