remove code duplication between publishimage and publishpdf conversionstrategy