bug fix inserting image in correct position