I still want to know where the image data will be when the script isn't running - and how the script gets that image data into the variable in the first place. Are you going to have a big array of numbers in the class file to represent the image data? That would be fun to alter. $image=array(0x47, 0x49, 0x46, 0x38, 0x39, 0x61, 0x5f, 0x00, 0x69, 0x00, 0xf6, 0x00, 0x00, 0x00, 0x00, 0x00...);. As for storing it in a database, not only is that a bad idea, but it still needs to be on hand to put it in the database in the first place - and what about the database schema?
Spitting out binary data is easy enough, just send a suitable header so the browser knows what to do with it, and send bytes (if you want to send a byte 0x54, just echo chr(0x54);, etc.). Then use the script name in the <img> src attribute, along with whatever would be necessary to get the script to output the image data instead of doing something else.
It still seems like a needless waste of effort, though. Maybe something along the lines of php-package might be a better way to go.