added if statement for inlining figures