fixes to issues #141 #143 and #128 for inline media