Yap, that would tidy up the code very much.  

But as a person who dealt with bunch of disorganized images before... I feel like i'm committing cardinal sins but perhaps it will work.