updated code to allow for rewrite of efosc imaging fits headers