cameronward turnermm Thanks! I think I'll leave the ptype as it is. The image is rendering correctly so I believe this code is ok (apart from properly escaping attributes)
andi cameronward I should use htmlspecialchars() to escape them properly correct? yeah. or use our own, shorter alias hsc()